Best tool ever for getting your macros just right! Fitzcairn's.
And the above code will do exactly what you want. Always prefer the @ syntax, to target= syntax, it's much shorter therefore allowing more efficient usage of your limited macro space.
Although may I suggest the following added feature?
Code:
#showtooltip
/cast [mod:alt,@player]Lifebloom; [@mouseover,harm,nodead][harm,nodead] Moonfire; [@mouseover,help,nodead][help,nodead][@focus,help,nodead] Lifebloom
Set the tank as your focus, and if you have no target or mouseover of any kind, the macro will default to casting the heal on the tank. Extremely useful.
Had to fiddle with this a little bit; adding the focus means you have to check for enemy mouseover/targets first, or it will never move past the @focus condition. Then since you want the mod:alt condition to always take priority, that has to move ahead of the enemy conditions, meaning that it first checks to cast Lifebloom on you, then checks to cast Moonfire, then checks to cast Lifebloom on the various friendly targets.