Riker rehearses the part of a man locked in an insane asylum in a play called "Frame of Mind" that Crusher is directing and he's supposed to perform tomorrow. (Have you ever stopped to consider how weird it is the crew seems to spend so much time staging plays in their free time?) But strange things are happening. Riker keeps slipping into a reality where he actually is institutionalized in an alien mental ward whose holding cell looks exactly like the set of the play. And you thought he had things bad when he couldn't get any sleep in "Schisms."
"Frame of Mind" combines the slowly escalating psychological dread from "Schisms" and the uncertain nature of reality from "Ship in a Bottle" and wraps them into a premise where reality becomes so much an open question that we have no idea what's truly going on until the show is over. It's a brilliant and conceptually driven piece of sci-fi writing from Brannon Braga on one of his better days, featuring a storyline that is simultaneously (and paradoxically) straightforward and labyrinthine, with a protagonist who is put through the terrifying wringer of experiencing two separate lives and not knowing which one of them is real. Facts from each reality spill into the other. Ultimately, Riker must face the possibility that he is losing his mind.
It all has something to do with an undercover mission on an alien world that Riker is (or perhaps already was, in the past) supposed to go on a few days after his play's performance. But the play still hasn't happened, and after spending a day in the alien mental hospital, he wakes up on the Enterprise on the morning he's supposed to perform. He performs the play. He hallucinates (or maybe not) an alien whom in the mental ward is his therapist, Dr. Syrus (David Selburg). He grabs the guy and shouts at him. He's embarrassed. A turbolift door opens and suddenly he's walking the halls of the mental ward. He crosses back into that reality and finds that it seems more and more real, while his memories of the Enterprise, explained to him as delusions by his psychiatrist, seem less and less so.
This might not work as well as it does if Jonathan Frakes' performance didn't carry us through it. But Frakes turns in a solid performance as a protagonist who is slowly broken down by the Kafkaesque weight of not being able distinguish reality from fantasy, slowly losing his grip as things fall apart. (This story would've been perfect for Miles O'Brien.) Like many of Braga's best conceptual stories, the truth lies is in the details (see also "Cause and Effect"). In this case, the way little details manifest themselves in each of Riker's realities and subsequently cascade throughout the story (the cut on Riker's temple that never heals, the way he was jumped from behind in an alley in his memories from the supposed murder he committed, etc.) makes for a puzzle that's always intriguing, sometimes dizzying. The production design of the mental ward is appropriately disorienting, hostile, and atmospheric.
The way the plot resolves itself — with the events of the entire episode essentially being a construct of Riker's mind as a defense mechanism attempting to ward off an alien mental probe — means that "Frame of Mind" isn't actually even required to hold together as a plot where you can figure out what's real, what clues have meaning, or why. Because, ultimately, none of it is real, which allows the story to become completely unhinged in its final act. Trying to "solve" it as a puzzle is ultimately not the point — which for some may come as a mild disappointment. But if you examine the pieces and how they were built from Riker's memories of recent events, it still holds up marvelously as a plot. But more important is how "Frame of Mind" exists at a level of dreamlike incoherence, with bizarre imagery and a ground that keeps shifting. This episode is about a concocted reality with cracks in it, which Riker is ultimately able to poke at until the entire surface of the looking glass shatters.