You'll never kill anyone that way, since you are
setDamageing to random 1 (which is 0 up to, but not including 1). You'll also end up healing sometimes

Also confused why compiling where you could just use standard function creation with {}.
glanceOfDeath = { waitUntil { cursorTarget setDamage (random 1); sleep 0.1; false };}; dummy = [] spawn glanceOfDeath;
or even simpler:
call { [] spawn { waitUntil { cursorTarget setDamage (random 1); sleep 0.1; false };};