Haven't paid a lot of attention to your code, but I noticed that you're using getLocalPlayer().getHealthPercent(). In the past, this method revealed as not completly functional for me. That for, if you even encounter problems with it, I suggest a simple change to:
getSkills().getBoostedLevels(Skill.HITPOINTS) / (float)getSkills().getRealLevel(Skill.HITPOINTS)
It returns in a form of [0; 1] but you can change that to [0, 100]% by just multiplying the whole thing by 100 (and maybe cast it to int, rounding it down if necessary).
Good job with the script anyway!