You should really get away from using OnGui. It’s best used for Editor scripts now. The newer gui is preferred and better than OnGui.
As far as saving score. You just have to save the value of the score variable. But as you really didn’t tell us much, my only guess is you want to save it to a PlayerPref and not online or to a backend service, etc.
PlayerPrefs.SetInt("HighScore", score);
Of course, you’ll want to use
PlayerPrefs.GetInt("HighScore");
to make sure you actually achieved a new high score before you save it.