The source of the glitch
To the programmer, who may or may not be trying to find a solution for the glitch on level 4 (or in my case, level 5 for some reason), the answer lies in the shield script. To the gamers who are have trouble with the glitch, if you just restrain yourself from pressing 's' on the keyboard, it should be fine. I encountered the same issue when I used the shield, but I tried again without it, and I beat the game without an issue. No glitches.