This is a unique and fun episode that, while never as impactful on subsequent viewings, is a real mind-bender the first time you see it (or it was for me, at any rate). There aren’t a lot of “puzzle box” style TNG episodes, but “Ship in a Bottle” definitely qualifies, and the show pulls it off quite well. Compared to the other examples that I can think of, in fact, I’d say that this is the best one purely in terms of how clever and effective the puzzle scenario itself is, even if some of the others arguably have a bit more going for them on a character level (I’m thinking, for instance, of season four’s “Remember Me”). TNG is not a show that tries to pull the wool over its audience’s eyes very often, nor would I expect it to be especially good at doing so most of the time even if it did try more often. But this particular episode goes for it, and (at least for me, and I think for others in my circle) it succeeds very nicely!
At this point in the show, it had been a while since TNG had last given us an episode that functioned as a sort of throwback sequel to a story from its own early years (I suppose “Silicon Avatar” was the most recent prior example). This one resurrected a story thread that I, for one, never expected to hear about again on the show—and one that originated in one of the show’s first truly enjoyable episodes. Thus, from the get-go, there is a certain wow factor to “Ship in a Bottle”: first it’s “they’re doing Sherlock Holmes again!”, and then, a few moments later, an astonished “they’re bringing Moriarty back!?” Then, a few scenes later, we get the first real “whoa!” moment of the episode, when Moriarty seemingly walks out of the holodeck and remains intact. I enjoy the way the writers gesture at justifying this impossible feat via the character’s own heady philosophical conceits about the efficacy of his conscious will and “cogito, ergo sum” and all, painting a picture of him as quasi-delusional in a megalomaniacal sort of way that feels very appropriate to the supervillain archetype that he embodies (and actually, this is one bit that works even better on subsequent viewings, when you realize that it’s all an act that he’s putting on to deceive the other characters). But at the same time, on first viewing at least, the scene also triggers a bit of a bullshit alarm: Wait a minute—is the show really doing this? How can they possibly justify it? Then, for a while, it seems to mostly sideline the issue, and the episode half-fools you into thinking that it’s actually just going to be some kind of character piece about Moriarty and his lady love. That feint is sort of interesting, if definitely in a “where exactly can this all be going?” sort of way…but then the show doubles down on straining our suspension of disbelief when Moriarty *somehow* manages to gain control of the ship. At this point, a viewer could be forgiving for suspecting that the entire plot thus far has merely been a collection of poorly justified contrivances designed to maneuver the characters into a situation in which they’re forced to work on finding a way to do what Moriarity wants. And, in a way, that’s exactly what it has been—except that the contrivances and the maneuvering are internal to the story, and it’s the regular characters themselves (not the audience) who are being asked to believe the impossible! And so, when the episode eventually arrives at its ultimate “whoa!” moment (the reveal that the characters we’ve been following have actually been in a holodeck simulation this whole time), and everything clicks into place and suddenly makes sense, it’s immensely satisfying!
I’m inclined to say that “Ship in a Bottle” is an episode that’s more about fun plot cleverness than character development or big ideas, but there are definitely plenty of thought-provoking ideas lurking in it as well, in ways both implicit and explicit. Moriarity’s grandiose philosophizing about mind over matter before apparently stepping out of the holodeck is not actually valid (and we eventually realize that he was merely putting on a show with it), but it is interesting to reflect on how everything that Moriarity achieves (or hopes to achieve) in this episode, he achieves (or works toward) primarily by deceiving others into believing that he has already achieved it. What we have here is an episode in which a “fictional character” wants to escape the simulation within which he exists and enter the real world, so he makes everyone think he’s done exactly that, then traps the “real” people in his own simulation/fictional world, fooling them into thinking they’re in the real word, and then gets them to work on the problem of replicating his apparent feat for another fictional character. Meanwhile, he also tricks them into giving him power over the “real” world (again by making them believe he already has it), so that he can then force their shipmates in said “real” world to replicate the efforts that his rats-in-a-maze have made within the simulation. It’s not too hard to read into all of this a commentary on the power that can be wielded by framing and shaping what others believe—or perhaps even a case for the efficacy of “faking it ’till you make it.” And then, of course, the “real” characters get wise to what is going on, and manage to turn the tables by running a simulation within the simulation, tricking Moriarity in turn into yielding the power that he has seized…without him ever even realizing that he has done so. What is real? Does it even matter? Moriarity gets duped in the end, but as far as he knows, he got what he wanted. And then, of course, everyone involved in this entire scenario is actually a fictional character in a story but doesn’t “know it”—and in the final scene, Picard alludes to the idea that any of us, in “real life,” could exist within a simulation, for all we know. Also, a couple of lines of dialogue riff on the ironies of being a fictional character become real in ways that play with the “mind over matter” idea while also raising questions about free will and determinism: when the countess asserts that Moriarity is a criminal “only because he was written like that” (echoing a famous line from Who Framed Roger Rabbit?), and when Moriarity himself acknowledges his awareness that the countess was deliberately created to be his love interest, but insists (betraying a rare and comical lapse in self-awareness) that he would have loved her regardless (whatever he imagines that to mean!). I owe this next observation in part to my favorite commenter on Jammer’s review site (William B), but there is a deeper question about whether or not Moriarity, as a program that has gained consciousness, can transcend his written origins as a villain, lurking in the shadows of the foregrounded plot issue of whether or not he can escape the holodeck. In this sense, “Ship in a Bottle” revisits the very theme (concerning whether an artificial being can grow beyond mere programming and exhibit original thought) that served as the launching point for “Elementary, Dear Data” and led to the creation of Moriarity in the first place—but this time, taking a less optimistic view on the matter (Moriarity’s resort to threats and deception reveals him as still being the villain he was written to be, and also forces our characters to dupe him and keep him confined within a simulation). Or alternatively, is it our heroes’ seeming neglect of Moriarity for the past four years that has forced him to resort to “villainy”? Does he write his own story, or is it dictated for him by his circumstances?
Also, even though this really isn’t a big “character” episode…what a delightful idea it was to use Barclay as a somewhat featured character! From a purely pragmatic point of view, of course, he’s someone we know but also someone who wasn’t around for the events of “Elementary, Dear Data,” so it makes good sense to use him as the character who initially stumbles across the Moriarty program. But it’s also just fun to see him, in particular, interacting with Moriarty and the countess, and generally dealing with the whole “what is real” situation of the episode. In truth, I would actually have liked to see a bit more done with this—perhaps some dialogue referencing his onetime absorption in holodeck fantasies that felt “more real” to him than the real world? Some actual character work might have been possible along these lines (or, failing that, at least some fun contrasts and parallels might have been drawn between Barclay’s struggles and Moriarity’s). But in any case, Barclay’s involvement would also have been worth it (even without anything else at all) just for his final line, which speaks to his characteristic neuroses while at the same time further underlining the whole “how do we know what’s really real” question that the episode wants to leave us with. Nicely done.

The story is a lot more of a mind-bender in the context of the 90s. I think audiences are a lot more accustomed to cleverness like this now, having seen lots of other stories like that. But watching it at the time, yeah. Also, the fact that TNG sometimes had done insanely dumb stuff like this in the past (well, maybe not *this* dumb, I dunno) might make you think that they were just going to commit to a bit like “mind over matter” gets you off the holodeck. As silly as that would be, it’s actually fairly consistent with Trek’s flirtation with new-agey woo science—the notion that thought is more fundamental than matter, for example, that has come up more than a couple of times in the series.
The fact that the antagonist in this story is explicitly a villain from a classic story adds some complexity to the questions here, and possibly clouds some things. I think it would be much easier to see Moriatry’s behavior and attempts to dupe the crew as a natural response to his peculiar circumstances if he were just a generic or generally context-less holodeck character. But if you were in his situation, wouldn’t you use just about any means you could to escape?
Also, I really wish the writers post-TNG had more imagination, because Moriatry should have been TNG’s Khan. First movie: callback to the original series (Generations). Second movie, the borg are the villains (featuring the return of the crew to the Enterprise E, assembled to mount a secret mission against the Borg). The third movie… Moriarty returns! It would be hard to pull off, but give me a room of writers and a month to shoot the shit, and I bet we could do it.