I know nothing about the E55. I know that Mercedes of that vintage were generally shit with respect to interior quality and the tech in them is straight out of the 90's. If those things matter to you, you might want to research them a little more.
As far as M5's go, don't do it. Back when I bought my car it had a list of common problems. There was the VANOS issues, the hydraulic SMG pump that cost thousands to replace and was basically guaranteed to fail, the several thousand dollar clutch jobs, the $500 brake rotors etc. I'd love to report that things have gotten better on that front.
Unfortunately they've gotten worse. Apparently the S85 has developed something of a rod bearing problem. If that's anything like we saw the on the V6 Taurus SHOs what that means is that some people will get lucky and just be able to replace their bearings with no damage to the crank. Other's will hear noise and that will be it. I can cope with SMG pumps and expensive clutches but living in fear that my exotic V10 engine is going to potentially grenade itself? No. Fuck that. It's not worth it.
Right now the cheapest S85 that I can find is $7000. Do the math.
Really the only argument that can be made for the V10 M5 over a tuned 535, other than owning a 4 door exotic car, is that it's faster on a road course and it is designed to put up with sustained abuse (a track session for instance) whereas the 535 isn't. So if you're road racing, by all means get the M5. If you're not road racing, and I say this as someone that absolutely loves the car, don't touch one. Even if you're replacing injectors on your 535 every year it won't be a fraction of the potential cost of ownership of an S85 M5.
Remember the golden rule when it comes to used German cars: Just because you can afford to buy it doesn't mean you can afford to own it. The forums are filled with "what have I gotten myself into?" posts and people that would come and make posts trying to determine the true cost of ownership were greeted with responses along the lines of "if you've got to ask you probably can't afford it". And they weren't saying that to be dicks. They were saying that because you could easily grab a 2007 for $20,000 - $25,000 and put 50% of your purchase price to make it right and keep it going. You know what I put on my 535 in almost 3 years of ownership? 6 injectors and spark plugs.
For everything else, read my article from Jalopnik. I still get hate mail for this. People send me passionate messages nearly 2 years later personally insulting me for daring to question the M5's greatness. Of course they don't actually dispute anything in the article.
10 Reasons The E60 535i Is Better Than The M5