Hey mate sorry for the slow reply. I've been quite busy lately trying to combine school time with programming hehe.
Anyway I've taken a look at your code and I must admit, It's quite brilliant

, infact if you wouldn't mind I'd like to continue improving my bots using your code. And if your up for it ( and not too tired

"Dont worrie I get that feeling a lot too hehe") then maybe we could code it some more together?
Anyway about the bugs you encountered, I've run the script on my account and ofcourse had to change a few things since my paladin is only lvl 12.
First off, the code you removed was a code I added to make the bot heal itself to full health after combat. This was just a "while scripting" idea I had, since I figured that it would be fastter then waiting for your hp to return. But yeah, like you said there were several bugs with it including the "heal over and over" bug. After testing the bot on my char, I don't see any immediate reason as to why I should keep it in, so for now I'll just leave it out.
Now to the code you wrote. You said you had some problems with the HP and Endurance threshold. Well for the endurance I found that you had simply the code:
"If (getPlayerPower <enduranceThreshold> getPlayerPower)and(getPlayerPower <getPlayerMaxHealth> getPlayerPower)" probaly isn't needed in the bot, but I always find it more comforting the more specific an action is. But feel free to remove that if you want to save some code

. Also since im only lvl 12, I dont have the endurance buff so I havent tried it out to see if it works. However I did try out the HP part ( which I changed the same way as I did with the endurance part) and it seemed to work fine.
Here's what I did for the HP part of the script:
I changed
"const healthThreshold = 80 "
to
"const healthThreshold = .8 "
Just because of the new equation that I was using, where the Max hp would be multiplied by .8, thus giving 80% of max health.
And I changed
"If ( ((getPlayerMaxHealth / getPlayerHealth) * 100) <healthThreshold> getPlayerHealth) and (getPlayerMaxHealth * healthThreshold)> getPlayerHealth)) Then "
Again the "((getPlayerMaxHealth > getPlayerHealth) " probaly isn't needed, but I placed it there just in case

.
Also I noticed a small typo regarding the health script which was
"Log.DebugLog "[*] Health has fallen below the threshold -- Attempting to cast Healing Touch!"
VGSendText HEALING_TOUCH 'Use healing spell
VGSendText VGSendKeyEnter "
Where the "VGSendText VGSendKeyEnter" is suppose to be "VGSendText VGSendEnterKey".
Finally, I rewrote your critically low health script from:
"If ( ((getPlayerMaxHealth / getPlayerHealth) * 100) <20>= getPlayerHealth) then"
Again I don't have the skill used in this script, so I haven't been able to test it. But I'm pretty sure that it will work. O and dont forget to add :
const CriticalHealth = .2
to get the script to work.
Finally, I did a little tweaking with the combatsleep time, and changed it from 2000 to 2500, im not sure how much of an effect this will have but i found that some skills where being activated before your character was ready to attack again.
Anyway I've included the script which I edited in this post, I call it paladin bot v2.0 ( version 2 since I think it has changed a lot

). I wont upload it to the main post till I get your permission though. And don't worry, you will be credited
-Antareus