Autodesk Map3D is one of the vertical applications. Map functionality is also bundled into Land Desktop and Civil-3D, and maybe others. But it's not in Vanilla Autocad.
And it wouldn't really work with Lisp, anyway. It's more a feature of the program, which makes it very easy for the user to do the type of cleanup you want to do, but Drawing Cleanup can't be done from a Lisp routine. If you really need a programmatical way to do the cleanup, well, it's an extremely complex task, and not even Autodesk has a completely-programmatical solution. You would need a full AI built into the code. The best solution Autodesk has come up with so far is Map, and it still requires a user to provide input to the process. It's not a completely-automatic procedure, but it works well. Unfortunately, you must have Map in order to take advantage of it.