This is how the scene for Twilight escaping and finding out Thomas is the bomb goes in Thomas and Twilight Sparkle's Adventure with Spy Kids.
Twilight Sparkle: I hope they find us.
Princess Cadance: Don't worry Twilight, I'm sure they will.
Twilight Sparkle: I'm gonna try to get out of here.
Twilight: If I cut some of the metal around that open circular part of the door, I should be able to squeeze out. [starts using her magic to cut the door] There! [jumps into the hole] Come on! [grunts]
Cadance: [aids Twilight in getting out] You're almost there!
Twilight: [pops out] Yes! I'm free! I'll try and find the others, I'll be back for you Cadance! [races off]
Back with the team.
[the whole group continues racing down the hall, when they find Thomas' headlight on the ground]
Holley Shiftwell: Oh no! That's Thomas' headlight!
Finn McMissile: I knew something was too easy about this.
Percy: We have no time to lose!
Emily: Let's step on it!
[the whole group continues racing down the hall, while Mako grabs Thomas' headlight]
At the Prison cell.
Thomas: [races in]
Thomas: Cadance! [doesn't see Twilight] Where's Twilight?
Cadance: She's went to look for you guys! Is everythng okay?
Thomas: No! I've got to get you out of there! The villains put a bomb in here!
Cadance: A bomb?!
Finn McMissile: [on radio] Thomas!
Thomas: Finn! I found Cadance!
Finn McMissile: [on radio] Listen to me! The bomb is on you! They knew you'd try to help Twilight and Cadance. When you were knocked out, they planted in place of your headlight!
[Cadance uses her magic to shut off the illustion spell on the bomb, which is now revealed]
Thomas: Oh no!
Twilight: Thomas! [walks up] There you are!
Thomas: Stop right there!
Twilight: I was so worried, are you okay?
[Professor Zundapp is about to detinate the bomb]
Thomas: No, I'm not okay! Stay away from me!!! [takes off in reverse]
Twilight: Thomas! Come back! [chases after him]
Cadance: NO! WAIT!! TWILIGHT! THOMAS HAS A BOMB STRAPPED TO HIM!!!
Twilight Sparkle: Thomas! Wait!
Thomas: Stay back! If you come any closer, you'll get hurt!
Twilight Sparkle: I know it seemed like that before, but it doesn't matter!
Professor Zundapp: (evilly laughs)
Thomas: Twilight, you don't understand! I'm a bomb!!! [turns around]
Twilight Sparkle: Yes Thomas, you are the bomb! You'll always be my bomb!
Thomas: Stay away!
Twilight Sparkle: No! Never!
Professor Zundapp: Almost there. [nears to the button]
Twilight Sparkle: I'M NOT.... GOING TO.. LOSE YOU AGAIN!!! [grabs his back coupling]
Professor Zundapp: [presses the button, but Thomas is out of range] Grr! AAH! [presses the button several times] GRRRRRRRRRRRR!!!!!!!!!!!!!!!!
Back at the Prison cell.
Toby: There she is!
Princess Cadance: Shining Armor!
Shining Armor: Cadance!
Emily: Are we glad to see you.
Mucker: Don't worry. We will get you out. Rusty!
[Rusty cuts the bars with his blowtorch]
Princess Cadance: Thanks!
[she and Shining Armor hug and then kiss]
Shining Armor: Where's Twily?
Cadance: She went thaty way, chasing Thomas!
Finn McMissile: But Thomas has a bomb on him!
Dusty: After that unicorn and tank engine!