Thanks for your prompt response! I have actually made a truncated version of my experiment to focus on fixing this break issue. Link to the repository: https://gitlab.pavlovia.org/tpham62/break_online
I am using a break routine so I tried both codes with the falsifications (!= instead of ==) but the break routine is now appearing after every trial. I was reading this post (Pause routine online) and I also tried to set the thisTrialsN counter to 0 but the break routine is still appearing after every trial (just trying any creative solutions, I have no experience with coding). Thanks again for your help!