This is not the wallhack but the quite low-frequency visibility-check-routine of the engine. You are quite safe to do this if you wait half a second after closing the door. Wallhacks are actual map bugs where waiting does not help.
@Travis_IOI, I am just assuming how it works, but please forward this idea to the ones who work on the engine:
I see that for performance reasons the engine has to keep track on which NPCs see 47, so when doing something illegal not every NPC has to be checked. I also see that this check is still costly for the performance, so it can’t be done at every frame.
But how about still putting one check on top of it?
If like in @Pagan’s video the engine considers 47 to be spotted because of the said mechanics, it could redo the check method one more time, without delay, with the updated map situation (closed door, positions of NPCs and 47, …). And THEN when 47 is still considered to be spotted, it should be okay.
For example, in Pagans Video there are just half a dozen NPCs who could see it with an open door. Rechecking just these few NPCs really should not take that much of performance. If your engine guys complain on situations where 47 does shit in public, just insert a case differentiation, where my script idea is runned. For example, if the last visibility check resulted in 47 being visible to “only xyz” NPCs, do my suggested, additional quality check. If more, then not.