They never had the source code and edited the PMachine bytecode in the script resource, the SCR file directly. I'd be willing to bet this cracked version far predates any SCI Companion with a decompiler they could've used.
Part 1
PMachine: Load the entered code, load the correct code. See if they match.
Script equivalent: (== local11 9731)
Part 2
PMachine: If the last condition is not true, skip over 0x30 bytes from here, to the B block. Implicitly, if it was true, continue to the A block, which is the next 0x30 bytes worth of code.
Script: (if <the part I just described> <A block> else <B block>)
Part 3
A block: clear the "door locked" flag, cause the keypad inset to dispose, then jump to the end of the method.
Part 4
B block: make the Narrator say that was wrong, then jump to the end of the method.
The interpreter, when running this, sees the bnt opcode and blindly follows orders. If the code doesn't match, skip over A block to B. The narrator says you're wrong. If it does match, don't skip ahead and continue on to A block, unlocking the door.
In the hacked version, part 2 is changed to jump zero bytes instead, so it runs A block either way: (if (== local11 9731) <A> else <A>). The interpreter never gets to even consider the code in B block, it's never run.
Now look at it from a script decompiler's point of view. In the "clean" version, it can tell there's two distinct paths and emits (if (== local11 9731) <unlock and dispose> else <complain>).
In the hacked version, they're both the same path and it too never gets to even consider the code in B block. The condition effectively cancels out and only the part that's actually logically possible to ever run is decompiled. And since it canceled out, why bother with the "if" block?
But it already considered the expression being evaluated, so that stays behind. (== local11 9731) <unlock and dispose>.
If they did use source code editing, the entire B block would've been missing and everything that came after would've shifted up in the bytecode. It's still there, so they didn't.
Edit: to clarify, every single "source code" version we've been looking at so far was our own decompilations. Because we don't have The Actual Source Code as written by the Sierra programmers. All we have is bytecode.