I thought could be much, much simpler.
Then, I remembered variables.
So, I took some number graphics from Strife and made a good safe script to use, maybe if you want Doom 3-style combinations.
Included is a demo map with the script in it. The script is easy to modify, to put your own codes,
maybe a 4-digit lock rather than a 3-digit lock. Very customizable.
Also included is a seperate "safedemocode.txt" file which is a copy of the SCRIPTS lump in the map wad
with added comments to explain (so that you do not have to open my map in a wad editor to see it),
although I still recommend playing the demo wad to see it in action (for proof it works).
The download is right below.
Spoiler:
Spoiler:EDIT:I noticed that the number textures looked messed up, since I used HUD graphics that should be transparent.
This doesn't happen in GZDoom. It's just black in some spots, that's all.
Also, no need to credit me for this.