dosbox-staging 0.78.1, cycles=max
On this version you can guess the code to the lab (between 5858, 7572, 8640 and 3301), but only AFTER the cutscene where Dr Fred plays Meteor Mess played. It plays about 4m25s after you fix the wires, so that is priority number one. Afterwards I get the dungeon key, not only because it is less boring, but also because getting captured one more time delays the Dr Fred cutscene by around 5s.
The 'New Kid' glitch that let's you warp to open doors still has tons more potential, but you also want to avoid using it after fixing the wires, because the longer the New Kid menu is open, the longer the Dr Fred cutscene is delayed.
Playing the original game on dosbox gives you super sluggish controls, a very different game compared to playing on ScummVM.