The episode starts with Sarah Jane sneaking out of her home for "a traffic report meeting" but with help from Mr Smith and K-9, Luke, Rani and Clyde find her in a restaurant with a man. As they are leaving, Clyde is puzzled by the sound of the TARDIS engines. Sarah Jane returns home and finds out that she was spied upon, but seems happy and announces that she is seeing a man, Peter Dalton, and that she has invited him to Bannerman Road.
Sarah Jane tells Luke that she is worried about what Peter might think about her adventures. Luke tells her not to worry and that she looks happy. After Sarah Jane leaves the room, Luke also hears the sound of the TARDIS. When Peter arrives at the Smiths' house, Sarah Jane tries to hide all evidence of her extra-terrestrial adventures, but a parcel arrives containing an alien creature. Rani and Clyde, who were trying to see what Peter was like, take the parcel back to Rani's house. Peter arrives as Clyde and Rani leave, but Rani's mother runs across to also look at him. In the Chandras' house, Rani and Clyde see a multi-eyed slug-like creature burst out of the parcel; detecting the alien, K-9 leaves Sarah Jane's house to warn about the creature. Luke manages to explain K-9 away as a prototype toy. K-9 then joins Rani and Clyde in trying to catch the creature as Sarah Jane, Peter and Luke go for a meal. During the meal, Rani, Clyde and K-9 manage to bring the alien slug to the attic where Mr. Smith teleports it to its home planet, Polongus.
Two days later, Peter proposes to Sarah Jane, who accepts. He gives her an engagement ring, which glows red. Meanwhile, Rani and Clyde investigate Peter's home, which they find to be unoccupied. Back at the attic, Sarah Jane reveals to Luke, Rani and Clyde that she has agreed to marry Peter. Rani and Clyde tell Sarah Jane and Luke that they checked Peter's house and found it empty. The engagement ring glows again and rather than getting angry, Sarah Jane seems happy and explains that Peter has another flat in London, which she has visited many times. Mr. Smith detects an anomaly when the ring glows, but Sarah Jane orders Mr. Smith to deactivate.
When the wedding day arrives, Clyde still has his doubts, but Luke tells him to keep calm and not ruin the wedding, and asks him to help hide K-9. During the ceremony, when the registrar asks if there is any reason why the couple should not be wed, the Doctor bursts through the doors, demanding the wedding be stopped. As he warns Sarah Jane to step away, the Trickster appears and kidnaps Sarah Jane. The Doctor tries to save her but she, Peter and the Trickster disappear.
As Luke, Clyde and Rani regain consciousness, the Doctor introduces himself, swiftly revealing that they and K-9 are the only people in the hotel, which now exists in a white void trapped at 15:23:23; the Trickster has literally trapped them in a second, cutting them off from the rest of the world... and, more importantly, cutting them off from the TARDIS, which cannot materialise properly. Using K-9's sensors and the sonic screwdriver, the Doctor is able to determine that Sarah Jane is trapped in another second, deducing that the Trickster has separated the two groups to prevent them helping Sarah Jane.
As Sarah Jane realises what has happened, she removes her engagement ring, realising that it has been influencing her actions. Peter protests that the 'angel' (The Trickster) told him that the ring would only ensure everything worked out at the wedding, and points out that Sarah Jane accepted his proposal on her own. As Peter explains that the Trickster came to him when he had an accident at home, offering him his life and the love he never had, the Trickster states that Sarah Jane and her allies were only to be returned to the real universe when she says "I do".
While attempting to find a way out of the hotel, the Doctor confronts the Trickster, revealing that he is the personification of the Pantheon of Discord, the Trickster reciprocating with his own knowledge of the Doctor and explaining that, with Sarah Jane's marriage marking the beginning of her new life, she will forget her old life of defending Earth, creating more chaos for the Trickster to feed on: the Trickster also remarks ominously to the Doctor that "The Gate is waiting for you!". As the TARDIS appears, attempting to 'lock on' to its pilot, the Doctor explains that they can use the artron energy that powers the TARDIS to fight the Trickster, but his attempt to help Luke, Rani and Clyde into the TARDIS fail, with the TARDIS and the Doctor being cut off from the hotel as it dematerialises with the Doctor still inside. However, Clyde's attempts to enter the TARDIS result in him becoming temporarily charged with artron energy, allowing him to attack the Trickster.
The Trickster's power momentarily disrupted by Clyde's attack, the Doctor is able to materialise the TARDIS in Sarah's second, telling her that there is only one way to end the Trickster's deal. As the Trickster and Clyde appear, both momentarily weakened by Clyde's attack, Sarah Jane tearfully informs Peter that the only way to stop the Trickster is for Peter to take back the deal, even though this will mean his death; Peter genuinely died in the accident, and is currently only living a half-life that will become real once he marries Sarah Jane. Although the Trickster claims that Peter is too weak to make that decision, Peter states that his love for Sarah has strengthened him, ending the deal and returning the hotel to the moment before the Doctor's arrival, with Peter having vanished and nobody else but the heroes remembering anything about the presence of the Trickster or the Doctor.
As Sarah later cries in the attic, she is joined by Luke, Rani and Clyde, who console her on her loss before the TARDIS materialises in the attic. After the Doctor allows the three children to look around the TARDIS, he departs once more, assuring Sarah that she still has an incredible life ahead of her.