A problem with using
/use on a slot is it'll activate whatever is there regardless of what it is. You can easily run into situations where it'll try to activate the ability on something you already have equipped before swapping it out. Changing the order in which
/use and
/equip are run in the macro doesn't seem to matter.
Also, if you want to swap in multiple different cloaks, then using bag/slot IDs to re-equip your old cloak will no longer work as each teleport cloak option will be in a different bag/slot.
For an in-depth guide on macro conditionals, see
Secure command options - WoWPedia for how to construct them and
Macro conditionals - WoWPedia for a reference on specific conditions.