Woody Allen’s “Whatever Works” is a new movie, but it’s based on a thirty-year old script that he’d written for Zero Mostel and has now updated for Larry David. And that has both benefits and drawbacks. The picture includes some of the joyously neurotic dyspeptic rants that characterized the early Allen but have largely disappeared over the years (1997’s “Deconstructing Harry” was the last shining example). On the other hand, its basic theme about destiny bringing the right people together (the ultimate message can be encapsulated in the old phrase “go with the flow”) is trite, even if Allen spruces it up with pseudo-intellectual dialogue about quantum physics. And David doesn’t prove an adequate substitute for either Mostel, or Allen himself.

The picture begins promisingly, with Boris Yellnikoff (David), a curmudgeon unafraid to express his brutal opinion on every subject, haranguing his buddies, who include Michael McKean and Conleth Hill. In the first of many contrivances that suggest the picture might originally have been imagined as a play, he notices the audience and proceeds to address them directly while the other characters look on uncomprehendingly (a nice aside on the hoary stage convention). He tells us of his past as a brilliant physics prof at Columbia who was “almost” nominated for the Nobel Prize (Boris is not one to hide his light under a bushel) and who, in mental turmoil over universal chaos, tried to commit suicide by jumping out the window of the tony apartment he shared with his then-wife, managing only to permanently injure his leg and lose his spouse. Now he lives in a dingy walk-up, supporting himself by teaching chess to kids in the park—and berating them and their parents while doing so.

Into Boris’ life waltzes ditzy Mississippi runaway Melody (Evan Rachel Wood), whom he reluctantly takes in and—in a twist of fate—eventually marries. When her mother Marietta (Patricia Clarkson) shows up, however, she’s horrified at her daughter’s situation. Of course, she’s not in great shape herself: her husband John’s taken off with Melody’s friend, their life savings have been wiped out, and now her deep religious convictions will be threatened by the loose New York lifestyle.

At this point, the focus really shifts from Boris to other characters. Marietta tries to get Melody to dump Boris and take up with handsome actor Randy James (Henry Cavill), who’s fallen for the girl at first sight. Meanwhile she loosens her own southern social bonds, finds self-expression as a liberated photographer, and moves in with one of Boris’ pals and a gallery owner in a menage a trois. To add to the complications, John (Ed Begley, Jr.) shows up looking for his wife. But he soon sheds his NRA credentials and smugly conservative values when he meets an unlikely kindred spirit in a bar.

This removal of the spotlight from Boris is required by the plot, which wants to show people careening from partner to partner like ping-pong balls, eventually winding up with the right ones, but it’s damaging to the laugh quotient, because apart from a conversation between John and a new character, Howard (Christopher Evan Welch) which is the wittiest part of the last act, “Whatever Works” doesn’t go particularly well whenever Yellnikoff is off screen. To be sure, there’s always David’s voiceover interjections to enliven things, but most of the action involving Clarkson, Wood and Cavill away from him is stale and rather boring. Only when Begley makes his appearance do matters perk up again.

Even when the focus is on Boris, moreover, David isn’t quite up to the task of embodying this Allen surrogate. He’s great doing his shtick on “Curb Your Enthusiasm,” because in that context his generalized, amateurish quality fits. Here, however, he seems only sporadically at ease, and especially in the long rants, which must have been difficult simply to memorize, his concentration seems to trail off. He’s just not much of an actor (as his scenes playing Max in the “Enthusiasm” story arc about his starring in “The Producers” showed). Luckily, the sharpness of the verbal barbs Allen’s supplied him with makes up for much of the weakness. Of the other players, Begley and Welch come off best, largely due once again to the quality of the writing. Wood and Clarkson, by contrast, work hard but never get much past caricature, while Cavill is stuck with a character who’s all empty veneer. The lesser supporting turns are often fun, however, and help keep the picture afloat.

“Whatever Works” ends happily. The fact that it’s due to another Yellnikoff suicide attempt is an amusing twist, but it also points up the rickety quality of the script, which sometimes seems as random as the interpersonal connections it’s about. That’s the point, of course, but it’s a pretty thin one, despite all of Boris’ pontification. Still, though this is lesser Allen, it contains enough laugh-out loud moments in Woody’s old vein to make it an enjoyable trifle.