Avoid the V8 at all costs. My father had an E39 540i when new, and even back then with low miles that engine would have countless problems. BMW just doesn't have luck with their V8's. Find a nice BMW with the 2.5 or 3.0 M54 I6. Much more reliable, but will still leave a hole in your pocket, especially if you get the dreaded cooling system failure. They are out there, just hard to find. Found an original owner 05 E83 X3 for my youngest son with $15k of BMW Service Center receipts
and was able to take it home for $3500. Took me over 10 different BMW's to look at, but finally was able to find a good one to replace his 323i. 25k miles later at 163k its had its Starter and Vanos Oil Line done, although the oil pan is leaking now, but overall running strong. *knocks on wood*