Your macro and the one I presented works exactly the same, with the exception of the harm/exists check and mine saving a few characters. I reread the first post and he did indeed specify at a point there that it should go to mouseover if no target was selected, so the [exists] check is rightfully the first option you'd go for. I will still argue for [harm] being a better option though since, as you're saying, the macro attempts to cast an offensive ability that can't be casted on friendly targets. If you have a friendly target you obviously don't want to cast your spell on that target, however since you're pressing the macro you obviously want to cast that spell. With an [exists] check the macro says you have a friendly target and stops, with a [harm] check the macro says that your target is friendly and guesses that you you wanted to cast on your mouseover instead.
So if you find yourself in a situation where you have a friendly target and would like to cast your spell, you have a few options:
1. With [exists] macro: drop your target, target new enemy, use macro - 3 key presses
2. With [exists] macro: drop your target, use macro on mouseover - 2 key presses
3. With [harm] macro: use macro on mouseover - 1 key press
Having an extra key press in rare situations won't cost you much, but if we're talking about optimization a key press here or a key press there will save you some time in the end.
And lastly, looking at your macro, without changing any functionality at all, you can shorten it down quite a bit. You repeatedly wrote the same spell name 3 times in the same macro, when you can get away with only doing so once. To cast spells with several condtions in the same macro you can do so by separating them with semi-colons, like you did in your macro, however you can use several conditions before the same spell and the macro will choose the first condition that comes true. So instead of having
you can shorten it to
Note the last empty bracket, that basically means cast spell with no conditions, or default settings as you called it and prevents the red question mark.