Freerider is right on the money. The 540 is a little heavy on fuel around town but if you drive without a lead foot its actually not that bad.
Whatever you do don't buy a 520i, engine is way too small for the car and you have to really rev the guts out of it to get it going.
If you want a decent amount of power and good fuel economy, go for the 525i. The later M50 engined car has 192HP (1991 to 1995) while the ealier M20 engined car has 170HP (1988 - 1990).
I agree with Tigger though...a 5 speed 535i would be an extremely good buy. Right amount of power a torque plus a bullet proof engine, if it has been serviced properly. Bimmerman would agree here too.
About the 530i V8 E34...to quote somone off a international forum, the 3.0L engine has all the complexity of a V8 but none of the power...you would be better off with the 540i in this case.
Regarding the maintenance, the 540i isn't that exspensive in my opinion. Make sure you get it inspected before you buy incase it has any compression issues.
Read ->
http://www.usautoparts.net/bmw/engines/nikasil.htm
Most people say if it hasn't died by now, it shouldn't.
Also make sure that the auto box goes into gear without any jerking and/or huge delays...this could indicate the valve body has to be repaired or worse a clutchpack is on its way out.
If you have any more questions, shoot me a PM.