ExtremeTech has another WoW guide, this week they explain how you can create advanced macros:
Macros have been around since the beginning of the game, but they've taken on a completely different shape and function with the release of The Burning Crusade expansion. Formerly, macros made complex decisions in combat by utilizing blocks of Lua code. That's no longer possible. However, a new host of slash commands has been added to replace (and in some cases improve) the lost functionality. These commands allow Blizzard a greater degree of control over what can and can't be done from within a macro. This chapter describes in detail what's currently possible with the revamped macro system, as well as what was intentionally disabled.