About everything I currently know about the diesel shut down is what I have read, no 'hands on' experience, but since I hope to own a 300SD by the years end I do read up on them.
If your engine isn't shutting down it is vaccum related. You have a vaccum leak somewhere in the system that is certain. The leak could be in the door lock actuators, the ignition switch, possibly the climate control panel, or the engine shut down device. This is inside the injection pump, it is a vaccum actuated bellows that pulls the fuel rack to OFF when you turn the key
the OFF. The bellows wear out and/or get oil logged and you see the result. There should be a brown vaccum line attached to the shut down device. If the bellows have been saturated with oil, possibly the vaccum line has oil in it as well which may cause it to be plugged.
I would start with the central locking system as it seems the easiest, and work your way to the injection pump. According to all I have read, it would be best to let a MB mechanic replace the bellows in the shut down, if that is where the leak is. I gather that if done incorrectly, you may cause he engine to over rev, and have no way of shutting down before you destroy the engine.
Again, this knowledge is not hands on MB diesel experience, it is from reading and learning. Hopefully it is close enough that the techs and experienced MB diesel mech can elaborate and help out further.
To qualify my diesel experience though, I used to (20 years ago) be a Detriot Diesel mechanic while working in the offshore oil field.
73 280 SEL