You cannot force an ISR to exit anywhere, it can only return to where the program was interrupted.
Any checking should be done each time round the loop that's waiting, and any variables used
to communicate between the ISR and the main program should be volatile.