Everything is WAI. The skill that cleanses at the start of the turn is a unique, not a special, so stun doesn't stop it from triggering and as long as traya is alive it works 'behind the scene'.
The order of actions is therefore happening like:
Traya reaches 100% tm -> unique meets condition to trigger, checks for debuffs and removes stun -> traya still at 100% tm takes a turn.
It shouldn't be too difficult to understand but if it is then imagine that each of the uniques on every character in the battle acts as a separate, invisible combatant who doesn't have a tm of it's own but rather waits for a specific condition to let it take an action.
If it didn't work this way then if traya was stunned while another sith was taking a turn then the debuffs on this other sith wouldn't be cleansed.