Ok, first... use code and not spoiler.
Second, you need to pay closer attention to your closing tags and what your rules are doing.
Try this:
Code
<rules>
<if Spell="Warp*|Teleport*|Recall*|Retrace|Escape">
<return />
</if>
<if status="Engaged">
<equip when="idle|engaged|resting|precast|midcast|aftercast" set="TP">
<main lock="t" />
<sub lock="t" />
</equip>
</if>
<if NotStatus="Engaged">
<if Area="Port*|*Adoulin|Ru'Lude*">
<action type="Equip" when="idle|engaged|resting|precast|midcast|aftercast" set="Town" />
</if>
<else>
<action type="equip" when="aftercast" set="IDLE"/>
</else>
</if>
<if Skill="HealingMagic">
<if spell="cure|cure II|cure III|cure IV|cure V|cure VI">
<equip when="precast" set="CURETIME" />
<equip when="midcast" set="CURE" />
</if>
<elseif spell="cura*">
<equip when="precast" set="CURETIME" />
<equip when="midcast" set="Curaga" />
</elseif>
</if>
<elseif Skill="EnhancingMagic">
<if spell="Haste|Refresh|Protect*|Shell*|Aquaveil|Blink|Boost*|Auspice">
<equip when="precast" set="CURE" />
</if>
<elseif spell="Bar*">
<equip when="precast" set="BAR" />
</elseif>
<elseif spell="Erase">
<equip when="precast" set="ERASE" />
</elseif>
<elseif spell="Regen*">
<equip when="precast" set="REGEN" />
</elseif>
<elseif spell="Stoneskin">
<equip when="precast" set="STONESKIN" />
</elseif>
</elseif>
<elseif skill="EnfeeblingMagic">
<if spell="Slow|Paralyze">
<equip when="precast" set="MNDENF" />
</if>
<elseif spell="Sleep*|Blind|Bind">
<equip when="precast" set="INTENF" />
</elseif>
<else>
<equip when="precast" set="MACCENF" />
</else>
</elseif>
<elseif skill="DivineMagic">
<if spell="Repose">
<equip when="precast" set="REPOSE" />
</if>
<else>
<equip when="precast" set="DIVINE" />
</else>
</elseif>
<if spell="Divine Caress">
<equip when="precast|midcast|aftercast">
<hands>Orison Mitts +2</hands>
</equip>
</if>
<elseif spell="Divine Seal">
<equip when="precast|midcast|aftercast">
<head>Orison Cap +2</head>
<legs>Orsn. Pantaln. +2</legs>
</equip>
</elseif>
</rules>
Also, may need to post your full spellcast, as I don't know if any of those sets exist or if you have variables for something that I'm not seeing.
Hope this helps.