The E34 540i (Pre 1997) sometimes had a problem with the nicasil lining in the cylindars but by now, most of the ones that were going to have a problem with it have already surfaced and been repaired. 540's are also known for a plastic waterneck that breaks easily but can be replaced with an aluminum one. See the sticky at the top for things to look for in E39 5 series (1997 to 2003)
Well My family owns 2 used 5 series and I drive one of them!! They are 1990 E34 535i(mine) and a 1995 525! And as maintence goes, mine has the bigger engine so its needs more tuning and needs mroe help but my Brothers 525 has no problem almost ever. He hasnt taken it to the shop in months and the only thing wrong with it is the coolant level and he is jsut too lazy to fix that. The E34 is a cheap yet reliable and great car to drive!! I suggest that!!