As I understand the numbers, you have $3,400 in the car and are looking at another $1,200 just to pass inspection (tho this might be lessened if you can only do an after-market cat) -- at that point you will be in for $4,600 and still have the a/c [a notable weak point in M-B's of this vintage], rust, interior, trunk leak, timing chain, etc. to deal with -- you can easily get up to another $3,000 (esp if you need to redo the front end suspension) to get everything mechanically OK without tackling the minor rust points. You'll then have an $8,000 17-year old car with 130,00 miles which will still be cosmetically challenged, assuming that you have dealt with all the mechanical issues.
There are likely other items which will come due soon, such as renewal of the radiator (plastic and good for 100,000 miles or so), and a valve job probably will come due in the 150,000 - 170,000 range. While an older Mercedes is a lot of car for the money (they really aren't building them to the old battleship standards any more) and will give good service when other cars have gone to the graveyard, there is a price to be paid at this kind of mileage even if the regular maintenance has been done.
For comparison, I have put over $7,000 into a '88 420SEL (see 126 Lower Control Arm is cracked --
) on top of the purchase price for a solid, Southern rust-free grandparent's car with only 75,000 miles. It's now a great car, esp for road use, but I won't get out of it what I've put into it unless I end up keeping it and driving out the investment.
Unless you really want/need the size and S-class features (the long-wheelbase 126 is a great model, but it is a leviathan) and can justify the expenditure, you might be better off cutting your losses, selling the car for what you have in it (or a little more in light of the "free" equity) to someone who's willing to take on the project and then getting a smaller car (like a late 190E or a 300E if you like the old M-B build quailty) in better shape for the $8,000 you'd be spending.