To write a play that is artistically superior to your typical soap opera may not be the noblest of cultural endeavors. But, at a time when Hollywood values screenwriters less than digital effects and much of primetime television comes without writing credits at all, one-uping “Days of Our Lives” begins to look relatively valiant.

The theatrical crusader is writer-director James Lapine, who won a Pulitzer Prize for Drama in 1985 with Stephen Sondheim for “Sunday in the Park with George,” and whose world premiere production of “Fran’s Bed” — which opened last week on Stage II at the Long Wharf Theatre — successfully outshines soaps.

To Lapine’s credit, he didn’t ride in on too high of a horse. His drama — a meditation on Fran (Mia Farrow), who fades in and out of consciousness in a hospital bed, and her dysfunctional family preparing for her death — often vaults comically into full-blown melodrama. This is, in part, to mock the contrived soaps set at hospital bedsides, to highlight that the stage drama is built of self-consciousness and a free-flowing structure that eases into memory and metaphysics.

In the most surreal moment of the play, a television mounted on the ceiling of the hospital displays the title sequence of a soap opera starring the characters of “Fran’s Bed”: Fran, her husband, their two grown daughters, Fran’s nurse, Fran’s lover. Then, the curtains behind the hospital stage set are yanked aside, revealing the backstage area of a television studio, complete with cameras, monitors and “On The Air” signs. The stage action — now paradoxical, passionate, stilted — is simultaneously broadcast on the television screens. For a few moments Fran and her family exist in harmony, inside their own daytime drama, but then the televisions short out, the cameras vanish, the lights dim and the play snaps back into — not reality, exactly, for Lapine is never too interested in realism — its usual realm of fiction.

But as Lapine lightheartedly rags on the soaps, he’s also paying them homage. There’s a reason, after all, that millions of intelligent people are addicted to the genre, and Lapine has trouble incorporating the effective attributes of soap operas into his own play without including soaps explicitly: inexhaustible intrigue, feverish emotions, ripe dramatic situations. “You have to love a soap opera,” Fran says with a dismissive chuckle in her first of several asides to the audience. But the statement seems to be as much of a sheepish command as a putdown; dipping into television parody for Lapine is less a joke than a lifeline.

What gets Lapine into trouble are the very techniques he uses to distinguish his art from daytime TV. An effort to steer clear of cut-and-dried morality and predictable narratives, compounded with Lapine’s aversion to slice-of-life portrayals, leaves the play in limbo, emotionally and intellectually. Lapine disorders time and space to allow for unreliable memories and prescient flash-forwards to have their stage. In addition, the play is premised on an epistemological question: we know that Fran is in the hospital because she downed too many pills, but does anyone, including Fran, know why?

That leaves Lapine very little fertile soil in which to plant his characters. Fran, played deftly by the wide-eyed and delicate Mia Farrow, seems to be disconnected from the play, hovering above or beside the action like a ghost or fairy. In the opening scene of the play, Farrow literally is Fran’s out-of-body experience. Dressed in a white nightgown and robe and gray socks, Farrow perches on a stool beside her bed, which is occupied by a first-rate Fran dummy that breathes on a respirator. The other characters interact with Fran’s body and not with Farrow, who verbalizes Fran’s inner monologue and editorializes to the audience, but even after the dummy disappears and Farrow enters the action as the sole pale, wavy-haired Fran, she still seems to be separated from the main action by a 10-foot pole.

Fran’s two daughters, Birdie and Vicky, played by the talented Kellie Overby and Carrie Preston, are equally isolated. Birdie, a sharp, smartly dressed Hollywood agent, lives in the world of her cell phone, not in the world of her mother’s demise. Vicky — uptight and neurotic, clenching her knitting needles until her knuckles turn white — barely manages to live at all. The only human being given any psychological or emotional complexity in the play is Fran’s husband, Hank (Harris Yulin), whose hourglass of patience seems to be steadily running out of compassion.

Interestingly, the transitions between time and place that prevent the story from going anywhere are the highlights of the evening. Inventive scenic design by Douglas Stein allows Fran to switch beds — from a hospital cot to a steamy hotel bed to a cold bed shared with Hank — silently behind the hospital curtain. And fine lighting design by David Lander makes the transitions fluid and seamless.

Given a top-to-bottom standout cast and a beautiful stage (albeit one that Fran describes affectionately and accurately as having “no personality”), if Lapine had a mildly engaging story to tell, audiences would be in for a real treat. But Lapine himself seems the most disconnected from the material. Though magical to watch at certain moments, “Fran’s Bed” is ultimately subject to Fran’s own criticism of soaps: in the end, they’re never satisfying because as soon as one obstacle is overcome, another hurdle — and another full complement of regret — appears.