You have to willingly commit acts against the Code or for Evil to Fall.

The suicide in this case traces to Japanese honour, which I've never really understood entirely. But I'm fairly certain she was wrong to kill herself right there. Her first task was to guard the gate, so she should have used her moment of lucidity to attack Xykon. Then, once she had won, she then kills herself to regain the honour she lost in attacking her allies.