If it currently runs for 10 minutes, that’s probably in a code component somewhere. I would start a clock in Begin Experiment (myClock = core.Clock()) then reset it before the loop starts in End Routine (myClock.reset()) and then check it at the end of each loop (e.g. End Routine in feedback).
if myClock.getTime() > 300:
loopName.finished = True # Change loopName to the current loop name
How does the experiment repeat? I can’t see an outer loop. Maybe whoever wrote it just made a very long flow.