Ergh.. Minor point on programming stuff I should have mentioned earlier: Always consider every value a variable could have, even if your code would 'never' *** assign those values. Here's what I mean: $miniprog is checked for being less than 99, equal to 99, and equal to 0. It is never checked for being greater than 99. While your current code would probably never let it go over 99, shtuff happens. Hardware glitch. Later addition to the code. Using the same variable name elsewhere in the code, whether you realize it or not... Or just plain coding errors. Always check, and make sure a variable can only be the range you need it to be.
The easiest and most logical way to do that is in the two ELSE IF $miniprog = 99... statements. Since they are checking for the upper boundary of the variable, and reset it to zero, it would make sense that any value higher than 99 should be reset as well. Just change it to ELSE IF $miniprog >= 99... and every eventuality is taken care of. Except less than zero, but I'll leave it to you to find out if that check is needed.
*** If you ever hear a programmer say, "That variable could never have that value", and they don't say "..because my code checks for it and corrects it if needed", then they need to get some more experience under their belt. Unless your code constricts a variable to the values that make sense for your code, you're opening up the possibility of a bug. The kind of programming needed for the Uno2 isn't so serious that you need all the tenets of this burned into your brain, but it's still a good thing to keep in mind.