Tell the scratch cat how high you want to go to test for prime numbers. He gets tired if you ask for more than 10,000.
My kids and I worked on this. My son was able to suggest several optimizations to the code, including (1) checking only odd numbers, and (2) attempting to divide them only by numbers between 3 and halfway to the number being tested. Yes, I know that in one of the academic papers on Scratch it was mentioned that kids want to do something fun with code other than calculate prime numbers...but we love finding prime numbers!