Terry Nation would write the episode, although Dennis Spooner suggested basing it around the contemporary police drama Z Cars (the Z Cars production team declined to be involved, even to the extent of refusing to lend Doctor Who their set). The episode ended up set in a Liverpool police station on Christmas Day, and then on a film set in the Silent Era, before the Doctor remembers it was Christmas Day at the police station and breaks the Fourth Wall, looking to camera and saying ‘Incidentally, a Happy Christmas to all of you at home!’
This is, as described, a necessary detour from the main story. The first episode was appropriately named ‘The Nightmare Begins’, and a torrid production ensued. Due to William Hartnell’s behaviour, the dressers went on strike, and scripts came in underlength (Spooner said he had to rewrite significant portions of Nation’s scripts, including removing a section where the Doctor invented the Custard Pie in the Face gag, but while documentation suggests there were some problems Spooner was also exaggerating). The new companion, Katarina, was killed off in Episode 4 as it was decided the character didn’t work, and the new production team decided her replacement in the story wasn’t what they wanted going forward, so that character was killed off too. The Chief Designer at the BBC sent a memo to John Wiles describing the shoot as a disaster, with the director Douglas Camfield being too busy to meet with the design team for more than five minutes.
The plot concerns the Daleks’ attempt to deploy a superweapon, the Time Destructor, leading the Doctor and his friends to go on the run from the Daleks and their allies with the main component of the Destructor. The first companion death ensued, and Katarina’s replacement was Sara Kingdom, a Space Security Agent who killed her own brother (played by future Brigadier actor Nicholas Courtney) before also dying at the end of the story. ‘The Dalek Master Plan’ is overlong but has some great scenes, genuine pathos, and from the existing footage Camfield clearly directed the hell out of it.
Thus, as with ‘The Chase’, the comedic elements of the middle episode can seem incredibly incongruous when you’re not aware of the Christmas Day context. Also, bluntly, despite the fact that Terry Nation’s background was as a comedy writer and Dennis Spooner delivered some hilarious episodes of Stingray, it isn’t the best example of comic Doctor Who the Sixties produced (which is, of course the story directly before this one, ‘The Myth Makers’).
Presumably the production team thought Terry Nation’s comedy episodes were amusing enough, because this is the second one he writes, and his first during ‘The Chase‘ has a sequence where the Daleks turn up on the Marie Celeste and everyone on board flees into the sea in terror to drown, including a woman holding a baby. This makes the first episode of Cucumber seems like an exercise in tonal restraint by comparison.