They are awesome driving cars, but don't expect frugal "Honda like" driving. These cars eat up expensive brake parts, require rigorous service to last, and are targets for vandals in large urban areas.
Personally, I'd be loathe to trust the ZF automatic thanks to many years of BMW using garbage ZF units behind V-8 and V-12 engines. Find out from a BMW specific mechanic about ZF reliability on E39 cars. I know that the E46 cars have auto-box problems.
When you find a potential car, have a PPI done by a BMW expert mechanic. Any suspension parts are very pricey, AC systems are usually reliable, but repairing them is very expensive. The V-8 cars require Z-rated performance tires, and they are expensive and need to be replaced frequently.
We owned a 1997 528i, and enjoyed it, except for the odd thing where you had to activate the AC compressor despite the ACC system. Goofy, if you ask me. We sold the car to a neighbour, and while it's been a good car for them, it's had it's share of glitches. Fortunately, they replaced an Intrepid with it, so everything else seems reliable and cheap to maintain!
Problems with E39's include some instrument cluster failures, AC/ACC problems, various electrical accessories and some suspension bushings/components.
The V-8 engine is complex and very expensive to repair, so ensure that the driveline is in TOP shape. Many people got burned by bad V-8's in the 95-era cars by buying a car with a "slightly uneven idle, needs plugs" when it really needed a whole new engine. The new 4.4L engines are not at all the same, but make sure you have good service records and have the engine evaluated carefully. Even a top end job on a BMW V-8 can run up close to $10K if enough stuff is wrong.
For a car that can give a 911 a run for it's money and carry four people in comfort and their luggage, used 540's are a true high performance bargain. Just remember, like most high performance cars, they need TLC, and finding one that had it is more important that getting a good deal. If you find a "bargain" 540, you'll probably pay lots more in the end.