This looks exactly like the script by stadja@LTN that Scarabium posted above.
What did you "modify"?
In the line 7 of the original script, you can see that the script tells the browser to go back to the list page after adding a game:
window.history.back();
This made my browser go back to the start page, so I modified it to click the button to go to the list page:
$('.nav_btn')[1].click();
I hope this helps.