This engine simply reads the variable highscore and if your score is greater than the highscore, your score becomes the new highscore, until someone gets a score greater. Tweak the code in a remix if you want.
I had an idea for this for a long time, so I decided to create it. Less wishing, more working!