You could do this, although waiting is a poor strategy. Interrupts may be a brute force way to overcome this, but there are better solutions.
I suggest gpiozero.Button specifically https://gpiozero.readthedocs.io/en/stable/api_input.html#gpiozero.Button.when_pressed
This will let you handle many more events with minimal overhead, avoiding all the ...
You need to design the structure of your script to support this usage.
Generally wherever you have a time.sleep() you will need to replace that with a loop testing for an early completion signal.
to something like