Breaking trial list every X trials

Your code is failing because you are using continue_routine = False instead of continueRoutine = False.

However, I would recommend using Routine Settings instead.