10-12 years from production date these cars usually get troublesome. Lots of electronics and systems start acting up, so you could end up investing a bit to keep the car healthy. It's not just the engine but everything else. An 04 model is likely built in 03, so it is 9 years old. Warning bells.
I am keeping mine 5 years max, then find a buyer and get a newer car.
How many E39s do you see around? They are a rare breed. Last production model was 2003. It was launched in 1997. Being phased out, retirement, grave yard.
Then again maybe you just want it for a couple of years and might be lucky. Or don't care that some systems aren't working 100%. Like A/C or traction control, things of that nature.
Audio: Jehnert Flatline speakers, Mobridge M1000 DA2 prepro, Helix P-DSP, Zapco Z-150.6 amp, CIC iDrive upgrade
Performance: MHD Pro Tune, AR Downpipes, ER FMIC/CP, DCI, RB turbos and inlets, KW V2 coilovers, Fuel-It Stage 2 pump w Ported fuel rail, Mfactory LSD