In your loop, create a case structure to test your pause button. If false, do nothing. If true, run another loop with a case structure that tests the continue button. If this button is false, continue looping. If true, exit out of the inner loop. Make sure your two buttons are of mechanical action latch type. Don't forget to put a delay inside the inner loop to allow the processor time for other events.