This post was published long before the Mists of Pandara Expansion.
The tips and techniques explained here may be outdated.

Warlock Banish Macro

BanishBanishes the enemy target, preventing all action but making it invulnerable for up to 20 sec. Only one target can be banished at a time. Only works on Demons and Elementals.

Much like sheeping.. but can’t be broken by hitting the mob. In fact I’ve often banished something and then set my minion on it just to build threat on the minion. Even though the banished mob isn’t taking damage they’re still tracking threat.
I wanted a macro that would make my target my focus and then banish them. Then I could switch to a new target and whale on it.. and then when my banish broke I wanted to be able to re-banish it without having to switch targeting. I also run the addon “FocusFrame” so my focus shows up as a unit in my UI so I can keep an eye on the Banish timer.

Set this up and use the “?” icon in macros. The first line will cause the Banish icon to show up. Second line: If my focus is dead or if my focus doesn’t exist, clearfocus. Third, if I don’t have a focus, then my target is my focus. Forth line (the real work horse), cast banish on my Focus.

You could easily change this to a sheep macro for a Mage. Knock yourself out