Move you mouse pointer and the rainbow will follow. Press 'x' to stop the script. Press space to restart.
Thanks to @cs3917207, the maker of the following project: https://scratch.mit.edu/projects/386328759 for inspiration :). (highlight and left-click the link and then press 'Go to' to see this project.)