Inside the game loop, the game is paused by pressing P, meaning that the game loop does not run anymore. Problem is that after this loop is halted, P cannot be pressed again to resume the loop, since it was inside the loop itself. How to make it so that when P is pressed again it makes the loop work again?
Don't actually stop the game loop when pausing the game. Instead, you have to add bool variable, that is changed to true/false depending if game is paused. If game is paused, you only have to stop updating the game, but you can still keep rendering the current frame including getting updates from input.
if(gameIsPaused == false)
// run updates
Make it so that pressing P switches to another loop that handles the game state "Paused" and allows to transition back to the original game loop by pressing P again.
You can actually put this all into the game loop itself and introduce a state variable, if you want and instead of turning off the loop, the state variable toggles between the execution of the respective state-specific code within the loop.