Here are some examples I can give you:
Advanced macro wrote:
/script if (UnitName("target") ~=nil and UnitIsFriend("player","target")) then CastSpellByName("Greater Heal(Rank #)") SendChatMessage("Greater Healing %T in 4+ seconds", "Party") else CastSpellByName("Greater Heal(Rank #)");end
/script TargetLastEnemy()
Other easy macro examples wrote:
/s Great King under the Mountain, it is not %t's time to end the fight!
/s <Resurrect %t>
/cast Resurrection(Rank 2)
/s Old High King, lend us the protection of your Great Crest!
/s <Shield %t>
/cast Power Word: Shield(Rank 3)
/comfort
/me says: Remember these words and remember them well,.. best be keepen yir feet on the grownd!
/hail
/me says: Good to see another proud Avian!
And here is a list of all the Globally Accessible Functions
http://www.cosmosui.org/texts/BlizzardCommands.xml
Looking around the UI Mod forums and sites will give you clues to some of the cool advanced stuff.