Alright, here we go. The Doctor has to use the power of fiction to save the day and end the serial.
Might as well go out with a bang.
Well, the Doctor is horrified to learn Jamie and Zoe were shut up into a book, and that made them fictional characters. If the Doctor is willing to surrender to the Master Brain, he can make his companions real again.
The Doctor still refuses because that would make him a prisoner, so he climbs a bookcase out rooftop window. See, those robots, like all robots the Doctor has met, can’t climb!
Anyway, up on the roof, the Doctor finds…Jamie and Zoe. But they can only say a few words and sentences. Crap! They must be fictional! But then the Doctor sees down into a chamber with an old typewriter writing stuff, so maybe that’s the key! He calls the Karkus to pry open the window and then uses Rapunzel’s hair to climb down…but then realizes if he writes himself into the narrative, he becomes a fictional character, so that won’t work. Climbing back out, he meets Gulliver and a bunch of bratty kids, and then Jamie and Zoe show up in the TARDIS and tell him they can escape.
Apparently, the Doctor forgot the Master is writing Jamie and Zoe and that TARDIS is a trap. He’s being held inside the Master Brain’s computer.
But that means the Doctor can use the fictional characters to fight the Master!
And so it goes! He needs to keep his companions alive, but the Master summons the toy soldiers to kill them!
The Doctor calls the Karkus to take out the soldiers!
The Master has the Karkus turn on Jamie and Zoe!
The Doctor says the Karkus’s gun is out of power!
The Master calls in Cyrano de Bergerac to kill Jamie and Zoe for mocking his nose!
The Doctor calls a Musketeer to stop him!
Neat sword fight erupts!
The Master substitutes Blackbeard the pirate!
Wait, he isn’t fictional…
Never mind! The Doctor calls up an armored and horseback Sir Lancelot!
Ah, but now the Master moves the white robots to attack the Doctor and destroy him so the Master Brain can conquer the Earth! (It’s complicated.)
But the Doctor…can’t do anything since it would make him fictional.
This is all very meta.
But by then, the Doctor made Jamie and Zoe real, or at least no longer fictional, and the two of them overload the computer. That frees the Doctor and the Master (he was really an innocent victim himself), and everyone races out because the last thing those robots were told was to destroy, and they might not stop with the Master Brain and its computer.
But that means the Land of Fiction may be coming apart. Fortunately, the TARDIS reforms. Did they get inside of it? I don’t know. That’s where the episode ends, but since there are more episodes, my guess is they probably did.
Let that be a lesson to you: don’t let your time machine get stuck in hot lava.