Simple IFs are not so bad but having to crowbar in a bunch of loops of various forms, and they get reasonably extensive at that, would be less than fun to asm hack into a NES game. This script is certainly not a "someone made a custom palette but could not be bothered to locate and alter the palette in the game proper" type lua script, or even a basic cheat that you might be able to put a little loop/hook in for and use it to hold the memory location changed by the cheat.
In that script a lot of the loops looked like they did more in the way of sanity and bounds checking, absolutely fantastic to have in code and I would encourage every coder to have them in basically all code until they can demonstrate they do not need it in a given instance. Embedded devices, much less adding to existing code running closer than not to the limits of the embedded device, would be one of those exceptions though. That means you could skip some of these checks out if you could be reasonably sure your code would not cause errors, for instance
-- Lots of hours? Just peg it at 99:59:59
if hours > 99 then
hours = 99
minutes = 59
seconds = 59
That is not really all that necessary to hack that in, it was presumably simple enough (you have the entire code, and some comments on it, right there after all) but when rendered as ASM you might have some fun trying to get it in there. Such a thing is not an isolated incident within that script either.