Importing and logging in using ScratchConnect every time using while loop causes spam to the Scratch API.
You can put the login code above the while loop and then the main content in the while loop. It will reduce the number of requests made. Also, use time.sleep(3) in your loop...