So...you know when I said that Doctor Who's greatest strength was its ability to slip effortlessly from genre to genre? I have to say, I didn't expect them to test it quite so hard so fast. 'Sentence of Death' essentially jumps from 'Wolf Creek' to 'Murder She Wrote' in the span of a single episode-opening recap, as Ian arrives in the city of Millennius only to be instantly framed for murder. (I'm not entirely clear on what Aydan's plan would have been if someone hadn't conveniently teleported into the room facing away from him. Maybe he'd have tried to claim that Eprim was an unusually enthusiastic suicide?)
Luckily, this is also the episode where the Doctor returns from his two-week vacation just in time to solve the murder. It's a clear homage to Sherlock Holmes, but it's amazing how well it works--not only because William Hartnell is clearly relishing the chance to strut around and act intellectually superior to everyone around him, but also because Sherlock Holmes' memetic DNA has always been part of the underpinning of the character. The Doctor is built, in no small part, out of the concept of the genius who instantly grasps the import of tiny clues, but holds his revelations behind a screen of smug contempt until the point of maximum dramatic impact. Despite the fact that it's clearly insane to jump directly into an Agatha Christie mystery, the return of the Doctor papers over the join perfectly.
And the mystery itself isn't bad--it's a bit obvious, with the Doctor fingering Aydan over the course of a single scene and revealing his identity to the court with a single Perry Mason-esque stunt, but they spin it out a little bit longer with a conspiracy theory. (Which would perhaps be a bit more suspenseful if they hadn't included a scene where Aydan called up his co-conspirator and they clearly showed his face, but c'est la vie.) As a result, we get what may be the best cliffhanger in the story so far, with Barbara forced to choose between sacrificing Susan and allowing Ian to be sentenced to death.
But the actual mystery isn't as important as the atmosphere created by the trial. The entire episode takes place in the pressure-cooker of Millennius' unjust and irrational judicial system; from the moment he arrives, Ian is fitted for the role of thief and murderer simply because it makes everyone's lives easier to have a ready-made villain. The moments before the Doctor's arrival are a perfect pastiche of Kafka-esque paranoia, as Ian confronts the fact that he is a stranger in Millennius with no-one to vouch for his character and no-one sympathetic to his situation. Even after Ian's friends and companions arrive, the justice system is clearly anything but just in Millennius. (Which makes a certain degree of sense, if they've had to reconstruct the entire concept of a legal system relatively recently after centuries of Conscience-enforced peace.)
On the whole, despite the utter strangeness of the transition, 'Sentence of Death' really does act as definitive proof that there's nothing Doctor Who does better than hijack another genre's stories and make them its own. And that William Hartnell does "smug genius" better than anyone.