This is how Thunderwing takes control of Twilight goes in Out of Twilight's Head.
[Twilight sees one of Celestia's guards' staff]
Thunderwing: [in Twilight's mind] Yes. Go on Princess. Obey my will!
[Twilight's eyes turn purple as she crushes the staff]
Princess Celestia: Twilight.
[Twilight's eyes return to normal as she looks over to see Princess Celestia and Princess Luna]
Princess Celestia: I needed that.
Twilight Sparkle: Really?
Princess Luna: What has gotten into you?
Twilight Sparkle: I don't know but Thunderwing has been talking to me in my mind recently.
Princess Celestia: Thunderwing still lives?
Princess Luna: And he's occupying your mind?
[Few hours later, Twilight wakes up but with purple eyes and walks by Princess Celestia and Princess Luna]
[Twilight activates the Groundbridge and runs through it]
[At location where Thunderwing, half buried in the Dark Energon meteor, landed]
Twilight Sparkle: [with Thunderwing's voice] Where is it? Where?!
[A flashback shows Thunderwing, after draining Tirek of his power, breaking out of the Dark Energon meteor, sending Dark Energon shards everywhere, with one going into the ground. Flashback ends. Twilight looks at one area where the ground is glowing purple and walks to it and uses Dark Magic to pull it out, revealing it to be the same shard that went into the ground.]
[Celestia, Luna, Starlight, Trixie, Thorax, and Discord wait for Twilight and she comes back throught the Groundbridge]
Princess Luna: Twilight what have you been doing? [sees Twilight has purple eyes and using Dark Magic and has Dark Energon in its grasp] Dark Energon?
[Twilight knocks out Luna with a blast of Dark Magic]
Princess Celestia: Luna!