I assume the macro fails if the popup appears?
If so, use store | true | !errorignore
for the part that might fail - then the macro continues to run.
Then check the value of !statusOK with the IF command. If !statusOK is false, then you can run the code to handle (close?) the popup.
See also How to continue running the macro if a certain step fails. It has some example code.