this script stops for 2 rounds when the 3'rd pet casts cocoon, fix is to replace the line:
standby [ self(#3).active & enemy.ability(Cocoon Strike:506).usable ]
ability(Ooze Touch:445) [ self(#3).active & enemy.ability(Cocoon Strike:506).usable ]
This particular ability also adds some damage which partially weakens the protection, and once a DoT goes past that, it won't miss or be stopped with cocoon. That being said, magic against flyers shouldn't be a big problem even with bigger health of the enemy and a negligible variety of yours :-)
I found this worked a lot better replacing the Ooze in slot three with an Empowered Manafiend (1,2,1) so that you can use its Arcane Storm to counter the Sandstorm, and therefor remove the RNG factor. In addition, as long as you take care to wait till just after he's cast Cocoon, Surge of Power makes a good killing blow. Fill with Arcane Blast.