Not very user-friendly at the moment, so consider this a readme.
First, you're going to need an initial savestate in slot 1 (Shift+F1) (can these scripts load savestates from a file?). It should be on frame 479, the first frame you can press start to enter a blank name.
test_frame is the sequence to start searching at. That is, the script will press start test_frame frames after the initial savestate (whether you created it correctly or not). You can alter this if you want to continue from where you left off. You'll also need to alter best and worst to reflect the values you found earlier. If this is your first time running the script, just leave them be.
The script automatically increments test_frame and starts over after it's read 6 words. If you want to read more words, alter the magic number on line 111.