The M54 IS bulletproof. Weve seen them go 400k+ km with basic maintenance. The engine is the least of your worries.
The cooling system refresh is mandatory - do the radiator, water pump, thermostat, all hoses, and expansion tank as a kit. Budget about 500-700 EUR in parts.
Control arms are another 400-500 EUR for a full front end refresh.
The E39 is one of the best BMWs ever made. If the body is solid (check for rust in the wheel arches and under the trunk), its absolutely worth restoring.
I restored an E39 525i two years ago. Best decision ever. These cars are appreciating in value, especially clean examples. A well-maintained E39 530i is worth 8-12k EUR now.
Budget about 3-4k EUR for a thorough refresh and youll have a car thats worth double what you put in.
the E39 is peak BMW. nothing they make today has the same feel. the steering, the ride quality, the proportions - its perfect.
just make sure the DISA valve is working (common failure on M54) and check the VANOS seals. both are cheap fixes but can cause issues if ignored.