That depends on the LISP.
Check my GETLEN.lsp. as an example.
A new get length LISP - AutoLISP, Visual LISP & DCL - AutoCAD Forums
It gets perimeters and accounts for gaps and overlaps even in anonymous blocks. I made that due to SOLPROF profiles being a pain with the overlaps, etc..
So, sometimes a cleanup isn't required to get correct information, just a LISP or other code.
I have one somewhere, but there are a few online "OVERKILL" type LISPs that work on blocks and sometimes better cleanup, something OVERKILL doesn't do all of the time.
But, OVERKILL does under normal circumstances do fairly well, so a first run with that, or a second run if the drawing needs a real flattening, best to do that first.
The waterjet/plasma cutter person at work does a lot of the work for those machines now, but I used to do all of it when those were first purchased. So I have done lots of cleanups for cutting. Luckily, most things I start are pretty clean except the SOLPROF and SOLVIEW/SOLDRAW objects.
The software that came with the waterjet also can do some cleaning. So I have that as well.