Help with Psychopy nested loop

Windows10
PsychoPy version 2022.2.5
Hello, I’m running an experiment that consist in showing a video (one video at a time from a pool of different videos) to the subjects and then the subjects have to press a button (z or m) to choose between two frames I show them.
All of this is inside a loop.
I wanted to put a different button to repeat the last iteration of the loop so if something happens I can show them the same video again.
I really don’t know how to implement that, can you help me?