There are three main ways to stop a running diesel engine (well four if you count stalling it with a load). You can starve it of air or fuel or you can reduce the compression ratio til insufficient heat is available to ignite the fuel air mixture. Also diesels can run so lean it wouldn't surprise me if starving it of air actually works by reducing the effective compression ratio instead of bringing the mixture below the lower flammability limit.
That mechanism in your picture does exactly what you think it does, it shuts off the injection pump by forcing the fuel rack on the pump to the full closed (no injection) position. Under most circumstances this will stop the engine. The compression release will also shut off the motor as well as aid starting. It does this by holding the exhaust valves partially open to reduce the compression ratio. My L175 doesn't have a fuel shut off (though one may be implemented in the governor control, I'm not sure) and to shut it off the machine is set to idle and the compression release pulled.
Now it definitely sounds like you had a run away diesel. It would have sounded unusually high similar to this
this though that is a two stroke engine. A run away diesel can happen two ways. First if for some reason the governor mechanism malfunctions and it no longer closes the injection rack in response to increased RPM. There are a few possibilities including a frozen fuel rack or a jammed set of governor weights. The second is when an alternative source of fuel is introduced to the engine. It's somewhat difficult to do on these engines but for example if a motor with an oil cooled turbo blows a seal oil can be mixed into the intake stream and suddenly the motor has it's own fuel supply independent of injectors and thus the governor system.
In either case the engine spins up til friction counters the power output of the engine which is usually well beyond what the motor was designed to handle. A lot of things are being over stressed at those speeds and eventually something will fail (crankshaft separation, thrown connecting rod, ect) and the motor will stop with a lovely crashing sound. Shutting off the injectors will work in the first case but not the second. The tired and true method that works for either is to choke off it's air supply thereby preventing combustion like you did. A compression release should also work provided it can open the exhaust valves sufficiently.
In your machine I'd think the fuel shutoff would have stopped injection entirely regardless of a malfunctioning governor but it's possible the mechanism is damaged or the rack is frozen and the shutoff wasn't able to move the rack. From what I know of the D series engines the only way to get engine oil in the combustion chamber is a leaking head gasket, cracked rings, or leaking intake valve seals. Of the three I'd only give credence to the intake valve guides. If the head gasket or rings were that badly damaged I have my doubts it could generate enough compression to run. Oil being blown in the intakes would do the trick though.
So in your shoes I'd remove that plate marked STOP and if necessary the entire pump and see if the rack moves freely. I'd also take off the intake manifold and inspect the pockets and stems for oil.