My dad drives a '97 S320 LWB and it's been a pretty good car. He's getting up in years and doesn't exactly rack up the miles these days, but still, the car has treated him well.
Can't comment on the cost of repairs, his is still under warranty. He bought it very slightly used - 1 year & 2K miles old. I insisted his dealer run it through Starmark, and he then bought out the warranty as long as it would go. So it's still under warranty for another couple of years.
Problems - I've not heard of many. His dealer did replace the head gasket due to some mild oil leaks. Standard stuff for the M104 engine. I recall they replaced the belt tensioner because it was making a bit of noise, and a door check strap for the same reason. I think the dealer found all these problems during routing service - my dad never even noticed them. I don't think the car has ever had any other problems. Certainly it has never broken down.