Sorry to hear for all your troubles.Most used car dealerships will mask or fixed the problems temporarily,but car with a not working cooling fan is a bit too much.
My advice,there is a huge probability that all the problems(except the fan) are related to one thing.Just have the car scanned by an independent shop with a BMW scan tool like DIS or ISTA.Or buy that BMWHAT,I hear it is very good.
I have a used fan for sale with 40k miles,I will give you a friendly price if you are interested.
But after all,after 4 E38's the X5 couldnt be that bad