you guys seem to be missing the point here ... first off .. I stated "IF" you could purge with ObjectDBX. It seems Chuck is on the right track .. you can delete anything from the drawing, you just need to make sure you are not deleting somethingthat will corrupt the drawing. Preliminary tests on my end, show that you can safely delete unreferenced layers, linetypes, textstyles, blocks and mlines. The delete method will fail if the object is referenced and a runtime error will result. When deleting blocks from a dbx document, AutoCAD will crash if you attempt to save the drawing. You will need to do a saveas to a new file. Once you have successfully saved the file, you can remove the reference to the original file, delete it and rename the new file to the original name.
I have reviewed some code for a project built in .net that also suggests there is a mechanism by which .net libraries have additional safety built into them when writing out drawings using ObjectDBX, but I am not at liberty to disclose that code.
Suffice to say, I don't think you will accomplish this without lots of coding and error checking, especially not in lisp.