Loop exit

First, learn about interrupts. If you still don't want to use them then read on

This is a matter of polling. What I am about to suggest is not the most efficient implementation, but rather one that is easy to implement.

Here's what you probably have:

while (input != HIGH) //you might also be checking for some other conditions
{

 //do stuff here
 
}

As you've mentioned earlier, the loop will only stop after a complete cycle, because the conditions are only polled at the start of the cycle.

So why not poll more frequently?

while (input != HIGH) //you might also be checking for some other conditions
{

 //do something here

      if(input == HIGH)
            //suspend the program
            
 //do some more stuff
 
       if(input == HIGH)
            //suspend the program
            
 //do some other stuff
 
}

You can see now that within the loop, the conditions are polled twice.

I am not suggesting that check something after every single line of code within the loop, rather identify segments of code that can be run together and poll after those.