The point is this - a 2007 5 Series is worth more than £4k. Therefore the ones that sell for £4k tend to be examples you do not wish to own. If they were good examples, they'd sell for more. They are too new to be £4k.
A 2004 5 Series, or perhaps a similar 3 Series, is not worth more than £4k. Therefore there are probably quite a few examples that are nice enough but are £4k simply because thats all they are worth.
You need to work out what you want and then work out what to aim for in your budget to ensure you get a good example. If you want a 'fun car' then a cheap 520d is not it. However a similarly priced E46 330Ci Sport, or a Z4 3.0i or something will both be fun *and* not a total nail.
Frankly you could get a really rather good E46 3 Series with pretty much any engine bar the M3 for £4k quite happily. It's still going to go wrong, and it's still going to cost money to keep on the road, but it's far less likely to be a dodgy abused heap of crap than an 07 5 Series for the same money.
Alternatively look at what £4k gets you that's fun and isn't an old BMW - there are plenty of fun yet reliable cars around for £4k.
But whatever you decide, buy a car thats generally 'worth' the budget you have, don't buy a car that in reality should be worth much more because thats how you end up in nightmare scenarios with just thoroughly bad examples. Ask Acme for more details about buying cars for less than they are worth..