Serial print blocks if the buffer fills up.
If you use 9600 baud then the serial monitor can send about 960 characters a second, any more than that (or even if you get close) then it will block.
Ways to avoid this:
- Set the baud rate to 115200
- Don't send too much to the buffer
Without seeing your complete code it is difficult to offer better advice.