#enemyID is a great idea, which unfortunately doesn't work well at all.
If you trying to see if you still have an enemy to attack, check out my Honor and Attack script. Basically you find the monster from the list and get it's specific ID, then keep looking for that ID, when it's not found delay for about 40 (2 seconds) to avoid the corpse thing where it finds a new ID when falling...
#enemyHits has always been fun. You could use that exevent msg thingy and put the % above it's head

Ok back to #enemyID... here's the problem. What is attacking you?
See if there's more then one monster around that has you targetted, #enemyID goes to the last one. That means you could die to a Mongbat attacking you because #enemyID see's a dragon on the other side of a wall. You can try resetting #enemyID but that doesn't work right either.... better to avoid it's use.
For Bots, you can obviously use a journal scan based Server/Client approach. TM's j-scanning sub would be awesome for it.