There is a good reason the blender becomes unresponsive when a script is running. When python is computing your script and it takes a long time windows will time out the GUI update for blender. Blender is did not freeze, its just means that you cannot interact with blender at the time it is computing, the same goes for baking smoke simulation, you cannot change anything in your scene. You will just have to wait until your script is done.
Timeout Detection and Recovery of GPUs (TDR)
One of the most common stability problems in graphics occurs when a computer appears completely "frozen" while, in reality, it is processing an end-user command or operation. The end-user typically waits a few seconds and then reboots the computer. The frozen appearance of the computer typically occurs because the graphics processing unit (GPU) is busy processing intensive graphical operations, typically during game play. The GPU does not update the display screen, and the computer appears frozen.
Although blender does not run on the GPU, but rather the CPU it is still waiting for the python script to be done executing. Blender will not let you continue until your python script is done.
As far as script-is-running-do-not-turn-off-blender-pop-up, windows will not quit blender unless you click on the end process button. This is normal behaviour.