The game should be back in a normal state when you restart.
It's a horror minigame. Most of the doors in the building you are in will have been opened and you need to close them before time runs out (you will hear a fast tick when you're running out) to prevent the boogeyman from entering.
As far as I'm aware, neither succeeding nor failing bear any consequence. Your view will just gain a distorting effect for a bit and then come back to normal if you fail. And you just go back to normal after a chime if you succeed.
All in all, it's just a little minigame about closing doors. No need to rush if you do play it either, you've got quite a bit of time. Don't leave the building, though.