Don't put every sentence on a new line, use paragraph form. Use proper words, the word is you not u.
I also use a similar macro to incorporate HM and Pet attack and it won't select a new target until the current one dies.
If u have a target selected and not yet in combat it will use your selected target and not find another even if it is closer.
It will only search for the nearest enemy target if you have no target selected.