The first thing you ought to do is go to the E34 M5 Buyer's Guide and
FAQ and read it:
On M cars, the things that are certainly to be expensive are things
specific to each car: that is engine ($10-15K+ to replace), trans
(expect to pay in the $6-10K range), catalytic converters (yeah
aftermarket ones are available, but to do it right, factory ones start
at $1500) to name a few.
E34 M5s have self-leveling rear suspensions. Dinan and others offer
removal kits. But, if you want to keep it "stock", be prepared to fork
out some $$$$.
Otherwise, find the cleanest one you can, check for things like service
records, get it checked out by a good independent shop that specializes
in these cars, and enjoy!