Playing one row from the second spreadsheet after playing two rows of the first spreadsheet and then returning to the first spreadsheet again

Hi everyone. In my experiment I have a spreadsheet of five conditions. But what I want is to after presenting two rows, play a conditions from another spreadsheet and then return to the first one.
What I’ve done is to put a counter after each trial and after two trials nReps of the other spreadsheet loop (trials_17) become 1 but it doesn’t work.

counter+=1
if counter==2:
    regpitchreps=1
else:
    regpitchreps=0


Do you have an idea of how I can do this?

This also seems to be a candidate for my independent randomisation demo.