If your not totally against using spellcast you could always do something like this:
Code
<if spell="*Waltz*">
<equip when="Precast" set="Waltz" />
<equip when="Aftercast" set="Gain TP" />
</if>
and you just make a macro that says
Code
/jobability "Healing Waltz III" <stpc>
It will achieve the same thing with less complications.
I recommend using spellcast because it will always work (as long as you use it properly) with no human error or lag error.