530d is an awesome motor. If you are after an E39 then its the 530d Sport or the M5 - nothing else will be as good.
I shelled just shy of 10k for my 2002 E29 530d Sport 7 months ago and it has been faultless (apart from it wouldn't start one evening, but the problem was my key).
The horror stories you hear about on these cars seem to circulate around the pre-facelift models, post facelift ones seem to be a lot better with hardly any problems at all. Mine has just ticked over to 124k and it is superb and drives like new.
Best car I have owned. Period! - I wanted an M5, but I couldn't live with the fuel bill when doing 60 miles a day, so settled for the diesel - and at 45mpg (600 miles to a tank) I arn't complaining