Help with repeat loops

https://snap.berkeley.edu/embed?projectname=tic%20tac%20toe%20AI&username=avi_shor&showTitle=true&showAuthor=true&editButton=true&pauseButton=true

in this i have a sprite (sprite 3) that forver checks if the player is on the edge of 2 pieces. but because of the repeat loop it creats a lot of lag and ruins the gameplay. does anyone know a way around this

i think i kinda fixed it

I was going to say, why keep testing in a loop? Why not just test once when the mouse is clicked?

its too delayed and i didnt want to make another variable

OK well if you found a way that you like, great. :~)