This is a fantastically well rounded episode; firing on all cylinders with with what could have been a straightforward court drama.
Kirk is accused of a breach of protocol which results in the death of a crewman. This alone could sustain an hour long episode, but the concept is fleshed out to include some real humanity. The ship's computer records a sequence of events that implicate the captain, who claims it did not happen as such. The writers use this as a opportunity to pit man against machine, a theme already resonating in Star Trek's run.
Kirk's lawyer is the personification of this conflict. A brilliantly drawn and performed character, he is bookish and distrustful of modern computerization. He is introduced to us in a sea of books, the perfect visual image to associate with him. He's passionate and fun to watch. His costume is also wonderfully in character.
As if this excellent conflict weren't enough, another side character is given a great amount of interest. The prosecution attorney is one of Kirk's many female conquests. Still quite taken with the captain, she is torn between obligations to her job and the remnants of romance. It's a small role with a great opportunity for drama, and it is seized beautifully by the equally lovely actress portraying her.
There's a great sequence when Spock finally uncovers a way to prove Kirk innocent by playing Chess. You see, when playing against the supposedly infallible computer, the best he should be able to achieve is a draw. However, Spock is able to beat the machine FIVE TIMES. The computer has been meddled with, and the hunt is on for the one officer who could have altered it: the crewman presumed dead!
High drama ensues as the ship is searched before the court. The writer's do their duty by brilliantly heightening the tension. Not only is Kirk on the hunt for a man filled with vengeance, but in order to locate him they must disengage the ship's engines. As the orbit decays, Kirk has limited time to find his foe before the ship plummets to it's destruction.
Creating the plot-based necessity for the tension-building time limit is a legitimate and entirely earned method of dramatic enhancement. The audience doesn't feel played when there is a perceived need to have the engines shut off. It has been handled here far better than previous episodes where the methodology was obvious and transparent.
The episode ends with a truly funny (and entirely not forced) moment between the show's trio. Kirk and his lady-attorney-friend share a kiss on the bridge. After she leaves, and he returns to the captain's chair, flanked by Spock and McCoy, his only words are:
"She's a very good lawyer."
To which Spock Replies, "Obviously," and McCoy, "Indeed she is."