I would do it with a variable, but that's just me.
In your TP set replace the <neck>Justice Torque</neck> with <neck>$neck</neck>, then add an entry into your variables section defining it.
Code:
<variables>
<var name="neck">Justice Torque</var>
</variables>
Then under rules, you just need to add a rule which will set the variable to either Justice Torque or Peacock Charm based on what's in your main hand, like so:
Code:
<if equipmain="Hagun">
<action type="var" cmd='set neck "Justice Torque"' />
</if>
<elseif equipmain="Tomoe">
<action type="var" cmd='set neck "Peacock Charm"' />
</elseif>
I think that's correct anyway; I use a similar setup on DNC to swap Suppanomimi for another earring to TP if my subjob is something other than NIN. If there's a mistake or if there's an easier way to do it, please correct me.