You're likely to get better mileage from the 540, especially since the engine is newer. The key is inertia, where a bigger engine works less to keep a car at speed or to accelerate. People with 540 e34s seem to do better mileage than my non-Vanos M50 525i, by a few mpg. Engine management also has progressed a lot through the years.
I can't talk about maintenance much; a not too well taken care of recent car will cost more medium term than a well maintained older car, but you know that. Of course you'll have a learning curve for maintenance.
Even though the car is clean, an inspection will make sure there are no problems about. You just never know what's about to fail. I understand there is another forum where e39s are discussed more. You might want to look into a "what problems arise on the e39" thread, or a "what to look out for".
If the owner has a record of repairs, that's an excellent thing.
540i 6sp; sounds very tempting! Good luck !