Not all facelift 2007 520d came with the N47 engine.
But do you really need a diesel? Are you really putting the mileage?
If not really, go for petrol (hard enough to find...). Many diesels cars have DPF issues and with new regulations coming down (preventing you from removing the dpf), it will cost you a lot of money to fix