IMO, E39 doesn't age well. I would recommend getting one with reasonable miles, like 80K and one that has been well-taken care of.
The issues surrounding E39 are many and can pop-up anywhere, just to name a few.
I would say its design is not really geared towards DIY types. Often need special tools to accomplish something. There is "The BMW way". Some of it is pretty interesting and good, like the oil filter being on top of the engine, others not so good. Front end work is not that difficult.
You never know what new and interesting item will fail next. It's truly a "FORD" car after a certain mileage: Fix Or Repair Daily.
Basically it's easy to put about 5-6K into an E39 after you buy one. A high-mileage E39, meaning one with 100K miles has the reliability of a mid 1980's Ford, or worse even, with parts costing 3x as much.
I would only buy one that has been garaged, has low miles and has the majority of the above repairs done, at least the suspension and the cooling system. There are tons of these for sale now at good prices.
Basically, they are expensive to buy and expensive to keep on the road. And high price does not assure high quality and longevity. Dealership prices are absolutely insane. Think $4K to change clutch. 500 to change the transmission fluid. $12 for one spark plug. 40 for a vacuum tube. I am used to DIY to keep the ownership cost reasonable but it's not for everyone.
OTOH, there is plenty to like about E39. IMO:
The ergonomics are excellent. The seats are A+ and the heated seat is also very nice. It fits me like a glove. Everything inside is just right.
The handling is pretty good, better than X5 and for that matter, E39 Touring has more storage space than X5.
I like E39 Touring, it's just the right size. Not too big, not too small. And very practical.
The I6 motor is very nice. It's silent, has just the right amount of power IMO (but is even better with Manual)
The AC system is insane, it will chill you faster than the North Pole. On med, it's stronger than most cars on High. The heat is the same way. The high is some kind of crazy Turbo mode. When you turn heat on high, it takes high literally.
The handling is pretty good, basically 5-series E39 is a big and heavy car, cannot possibly handle as well as 3-series but the space is nice. Especially with Touring.
The ride quality is very nice. No FWD can compare. New struts make a huge difference. No regrets buying mine but does need a bit of maintenance. Find the nicest E39 you can find.