Why can't it just run once? It's something you only need to do once at the end of a game session. Certainly no need for including it in every frame.
I'd lean towards sticking it in a static utility function just for ease of editing later. Then in whichever method handles "what happens when a game is over" you just call over to the score-checking method and shuffle around high score order if necessary.
There's no "one best way" (arguably) to do it, but there are certainly easier-to-maintain ways.
First, just make it work. Then, if you want and have the time/need, make it work better