I have a 540iA that I swapped 5 speed, and I LOVE it.
It has 210k on it and I rarely have a problem.
The only thing to check out on them is the fornt suspension for wear. Most e34's have a shimmy at certain speeds due to worn bushings.
Generally, the 535i is the "most" reliable. It has a M30 which is near bulletproof.
DO NOT GET A 530.
It has a 3.0L v8. 215hp. Wimpy. The engine is the same externally as the 540i. Just down 70hp.
1995 is the best year for these cars.
The most desirable cars are in this order: (IMO)
M5
540i/6
535i/5
525i/5
Things you should avoid (generally):
530i
pre 1991 525i
automatics
If you're looking into a particular car, lmk and I'll give you my epinion on it. I am very very familiar with this chassis so lmk if you have any more questions.