I am not sure if this will help you or not but this is what I do. I currently range vorkath from the row of tiles I am currently standing on now. Using this method, all I have to do is step back as soon as I see the acid pool attack. The yellow line will ALWAYS be free of acid pools if you do it this way. The green x on each side represents where an acid pool will land or at least the closest it will land. Sometimes they are a ways away but this is the closest they will be. Once I step back onto the yellow line of tiles, I just spam click each side. It takes 2-3 seconds to walk, which I typically have a tick to eat a shark then spam click the other side and never take damage. If you use this method, you should have a far easier time writing code as after the initial step back into the safe zone of tiles and clicking a side, a timer could work. I always return to the line of tiles I am currently standing on in this picture.
A couple things:
1. When he sends the white fire ball your way to freeze you before the undead crab, have the script click somewhere off vorkath. I usually just click on the tile I am standing. I found that if you don't stop attacking vorkath, you might try to hit him again while the crab is running to you and you will not have the time to kill the crab before it will explode and hit you on death. If you click on your tile once the attack freezes you and then get your crumble undead ready, you will have 100% success rate unless you screw up clicking on the crab.
2. When he lobs the fire bomb, always move in one direction. I have found that if he uses that attack 2 to 3 times in a row, if you move backwards it will actually land on the tile you are moving to and NOT on the tile you were standing on when he used the attack.
I can't remember the last time I died at vorkath while killing him like this. Currently my fastest run is 1min 20s and I got vorki on KC 108 lol.