Thats not an M5 badge, it's an M badge.
Sport model 5 Series came with M badging on the steering wheel, gearnob and sills from the factory and you could have an M badge on the back as well.
530d's are awesome but very expensive - you are looking at around £2000-£3000 more than the equivilent 530i. You are unlikely to have much choice of decent facelift 3 Series Sports for £10k.
Personally I would chose the E39 over the E46 and this is a recommendation I make after driving various versions of both cars. Neither cars are bad - infact, both cars are excellent, but I noticed the 'real world' difference when I stepped out of the E39 I'd been driving all week into an E46.
The E46 feels like a cheaper car, no doubt about it. Not that this is a bad thing - after all, it WAS a cheaper car - but it doesn't feel as 'special' inside as the E39, and some of the materials are of poorer quality - I'm thinking here specifically of things like the centre armrest which has felt rather cheap, flimsey and squeeky in every E46 I've driven bar the 320Cd (which had 500 miles on it!), whereas every E39 one has seemed solid and squeek free, even on a 100,000 mile car.
The E46 has the handling edge - but the 5 Series hides its bulk extremely well - to chuck around you wouldn't think it was a huge great 1.5 tonne executive saloon at all, but the E46 has the same ability and is marginally smaller to start with so comes out on top, but on anything other than a winding B road the E39 feels the better car - it cruises more effortlessly, it feels more classy.
Personally I wouldn't turn my nose up at either but if you get an E46 it *has* to be a Sport model with leather - the cloth in the E46 just makes the whole car feel cheap, whereas the Cloth in the E39 whilst not as nice as leather doesn't have the same cheapening effect.
You get more car for your money with a 5, it looks more elegant as well and you are more likely to find additional toys like the comms pack with tv/satnav in an E39 than an E46 becuase it was a more common option amongst E39 buyers.
Running costs - something I've been doing research into myself to make sure I really can afford to run one.
Fundamentally, they are very reliable cars. Problems with them are few and far between. However, if you DO get a problem, it isn't likely to be cheap to fix on the same scale as a Ford or Vauxhall but I wouldn't have thought its a world away from the RX8 out of warranty repaircosts wise.
The engines themselves - the petrol engines are very, very reliable indeed and properly serviced will go on for ever - the diesels, well, pretty much the same but there have been reports of a spate of turbocharger faliures on 330d and 530ds, and a bill of £1000 to fix, so do be careful here.
Servicing costs range from £60 for an oil service at an independant to £400+ for an Inspection II at a BMW main dealer but provided you keep to independants or reasonably priced main dealers (They do exist, apparently) it's nothing too seroius and you wont be servicing it that often - both E46 and E39 have variable servicing based on the type of driving you do, and can go up to 20k between services depending on driving style.
Tyres - pricey, the E39's with 18" Style 37 alloys (An option on the Sport) have wider rear tyres - Eagle F1's are £140 each for the rears and £120 each for the fronts. 17's are cheaper - but only just. How often you need them depends on how liberal you are with your right foot...
... as does how much you'll spend on fuel. You can get 30mpg out of the petrol sixes but.. only just and only on a run - but there is no significant fuel economy difference between the 2.2, 2.5 and 3.0 engines in the 320/520 325/525 and 530/330 so get the biggest you can find.
The E39 also has two 8 cylinder engines - 535i and 540i - fuel economy is considerably worse, virtually all are automatics, but the 540i offers storming performance - 0-60 in under 6 seconds. 535i has the fuel economy of the 540i but the performance of the 530i so is best avoided.