Like I said, the C240 is bulletproof. Serious problems with the M112 2.6l engine are very, very rare. About the worst things that happen over time are leaky valve covers, cracked vacuum hoses, and bad idler/tensioner pulleys. Those are all fairly easy and inexpensive DIY's. The biggest complaint about the C240 is that it's slow compared more modern engines of comparable size and it doesn't get great MPG.
The supercharged engine used in the C230 Kompressor gets better MPG and offer better performance, but it requires more upkeep. Superchargers are good for about 100K miles, and after that, they are prone to trouble. Some may last longer, some may fail earlier, but a supercharger definitely will need to be repaired or replaced long before you (statistically) could expect any serious problems with an M112 engine. Replacing a supercharger is about a $2K DIY. Also, some of the early ones, using the M111 engine, were prone to timing chain problems. The later M273 engines are prone to wiring harness leaks that drown the ECU in oil and ruin it. Both are expensive repairs. But of course not every one has that problem. It's a small percentage, but enough that is causes problems as the vehicles age.
The 722.6 5-speed transmission that is found in all W203's (well, except the rare 6-speed manuals) is also very good. There are two concerns. One is a leaking pilot bushing seal on the electrical connector. It can wick oil into the TCU and ruin it. It can also leak oil on the ground. It's an inexpensive and fairly easy fix. Also, those transmissions were claimed "sealed for life", but they shouldn't be. They need regular fluid and filter changes. At one time, MBZ said do it at about 75K, but now, they "suggest" once at 39K, and many experts will tell you it's best to do it every
39K. My advice is when you get your car, do a fluid/filter change and
replace the pilot bushing seal at the same time. It will cost around $250 at an indy shop, or you can DIY for a bit less (parts around $150, but that includes a one-time purchase of a dipstick for around $40).
When you get into the C280/C350 of MY2006/2007, that has the M272 engine which is prone to the balance shaft problems. It was probably sometime in the MY2007 production run that the problem was solved. the only
way to know for sure is to check that the M272 engine serial number is higher than 468993. The easiest way to find the engine serial number is a lookup by VIN. Many of use here have access to EPC and can do that for you if you'll post the prospective vehicle's VIN. I'd avoid any MBZ with a serial number in the affected range. It may go for over 100K miles with no issues, or it might be like my CLK550's M273 engine and have problems at 30K miles. It's a $4K+ fix. Sometimes MBZ will provide out-of-warranty "goodwill" coverage, but often they do not, especially if it happens with higher mileage.
Finally, there are some other things to look out for in general on the W203. Up until sometime in the MY2004 production, they had bad radiators made by Valeo that allowed transmission fluid and coolant to mix. Make sure you don't have the Valeo - they replaced it with a Behr. Man y cars had them replaced under warranty. The easiest way to check is visually:
Valeo vs. Behr
This is not a bad DIY, but you do have to take a lot of "stuff" loose to get to it. My advice, if you have the Valeo and want to replace it yourself, do a transmission service at the same time since you will loose some fluid in the process.
One more thing that's annoying but not serious is that the antenna amp at the top of the rear windshield (under the stubby antenna) is prone to failure. Symptoms include poor FM radio reception and reduced range of the keyless remote locking feature. Some people have found that the module just pulls away from the glass and loses contact with the embedded antenna wires in the glass. The solution is to use something to keep it press back in place. Other have found the module just dies from heat. The real fix is an entire new rear glass with the module installed, and that's about $2K.
I hope I've covered the major issues. Keep in mind that in car forums, you generally hear about the worst problems. Few people just come here to tell everyone how wonderfully their car is performing, so it's normal to come away with the feeling that the cars have horrible issues. They really don't, but MBZ's are also not like Hondas and Toyotas that can go 10 years without a problem. The reason is their complexity. They are designed to perform at the top of the charts in all aspects. They are designed to last decades, but they require some extra care along the way. IME, I have found that they are fairly easy to work on. They use extra shrouds to keep things clean, and with few exceptions, components are easy to get to and remove. The longitudinal engine with RWD helps tremendously over FWD cars where things are jammed into the engine bay. Most maintenance parts are not horribly expensive, and in fact some things are downright cheap.
So yes, to answer your question, if I were looking to buy for long-term reliability, it would be a C240.