In my game "Harry Soupsmith" I did this as well.
Basically, I had to use two variables. One variable had to contain the two least significant digits, and the other has to contain the zero-to-three most significant digits. Thus you can have a maximum score of 25599

.
But to be able to use this "hack" you have to stop using the AGI-provided
"Score: x of xxx Sound: On"
scorebar/status bar/whatever it's called and write logic which makes a "fake" score bar for you! You have to make sure the score bar is updated and re-drawn, but also make sure that it doesn't get updated every cycle, only when it's drawn over or if the score (or sound?) changes. Then you should have an option to turn the fake score bar on and off (sigh...).
Besides, you should probably have a separate variable to add the score to, and then check if this variable is > 0 for each cycle. Then if it is > 0, you have to add this to the "least significant digit" variable. Then you must check if this variable is > 99, and then decrease this variable with as many hundreds as it takes to make it <= 99, and then add one equally many times to the variable containing the most significant digits. When the score bar is drawn, you need code to check whether the variable containing most significant digits is 0. If this is the case, print only the least-significant-digit variable as the score, and if not, print first the most-significant-digit variable value, followed by the least-significant-digit variable value which _has_ to have two digits! At last you have to reset the "add score" variable to 0, of course.
All this is a pain to get right, and you probably shouldn't bother if you don't like that challenge (which I did at the time I wrote the code

However, if you want the source to the (now abandoned) game I made, just say so! If I recall correctly, I also did this in a Hangman test game at one point, and I even adapted the AGI Studio tutorial game to have the new score bar in it, but I think I deleted it

.
Oh, and by the way, I haven't looked at Pharaohs (sp?) Quest, so I don't know how it's done there.
Cheers,
Magnus.