When a pop-up (dialog box) appears and exits your debugging session it is a pain... There is a simple trick to switch on debugging once you reach a pop-up box.
Do the following: Create a TXT file and save it on your desktop with the following command:
If you want to activate debugging on a pop-up/dialog box, simply drag and drop the TXT file from your desktop onto the pop-up/dialog box in SAP. Next time you press enter you will be continue in your debugging session.