The 1974 450SL has Bosch D Jetronic fuel injection. This is a very early form of electronic FI. When you say it surges - do you mean at idle the engine races up to about 1500 RPM, then dies back down to about 800 RPM? Continually up and down? That's a fairly common issue with the DJet setup.
The car has a throttle position switch, which tells the computer if the gas pedal is pressed or not. The computer is designed to cut off fuel flow if the RPMs go higher than about 1500 RPM without the gas pedal being pressed. Once the RPMs drop below about 800, the computer turns the fuel flow back on.
Now, why would it race? Uncontrolled air is getting into the system from somewhere. The most common point on this car is at the auxiliary air valve. It's toward the front of the engine, on the top driver side (US models). There's a thing that looks like a little silver cap with two black (thumb sized) rubber hoses coming out of it. Take the hose coming out to the right (as you stand in front of the car looking at the engine) off the engine, and put something over the hole that will now be sucking air like a fiend. Be careful not to burn yourself if the engine is hot. If the engine stops surging - it may even die, if the idle control valve is turned low enough - you have a tired AAV. These work on the same principle as the thermostat, and they do wear out. Bad luck, they're also very difficult to find, and ridiculously expensive. But at least you'll know what it is and how to fix it.