"The Comedy of Errors" has a painfully belabored beginning and an almost wantonly protracted ending. But in between Shakespeare provided a fair amount of merriment, and the Folger Theatre Group does quite well by it in the production that opened last night.

Director John Neville-Andrews has chosen to stage the mix-ups in and around the terrace of a posh hotel in the Mideast shortly before World War I. Nobody actually says, "Meet me at the Casbah," but there's a lot slinky, suspicious behavior on view, in addition to the general madness cooked up by Shakespeare. By stretching an interpretation here and there, Neville-Andrews has created room in the cast for a quick-fingered pickpocket, a couple of vintage bathing beauties, an Arab houseboy, vacationing European nobility, and an impassive Turk in dark glasses, who wields a rattan fly-swatter with dark and deadly accuracy.

Earlier this season, the Broadway-bound musical "Oh, Brother!" tried for similar results by plopping down "The Comedy of Errors" in Ayatollah Khomeini's Iran. While that attempt was wholly misguided, the Folger's update is often inventive and amusing. Its failures are only incidental, quickly gotten past. For the most part, the exoticism meshes nicely with the play and points up the enchantment that winds through all the confusions like a gilded thread.

Usually "The Comedy of Errors" is played as farce, with the throttle out and the accelerator flat on the floor. Shakespeare, after all, is depicting the tangle of misunderstandings that results when two pairs of lost twins (two masters and two servants) accidentally cross paths in the seaport of Ephesus. Marriages are momentarily threatened, reputations jeopardized, money misplaced. Embraces and beatings are invariably bestowed on the wrong recipients, and it takes Shakespeare most of his last act to put things to right.

Instead of opting for speed, however, Neville-Andrews has accentuated the puzzlement in the play. The emphasis is not so much on the evening's mishaps, but on the bewildering aftermath. Shakespeare's characters are being given time, between collisions, to regain their bearings. Of course, the collisions are fun, as they usually are. But the real novelty of this staging comes from those private moments of head-wagging and chin-scratching, during which perfectly befuddled creatures manage to convince themselves they know precisely what's going on under their noses.

None reaches more false conclusions--or reaches them with more phlegmatic aplomb--than David Cromwell, the master from Syracuse, although Cromwell looks as if he just stepped out of a P.G. Wodehouse novel. Cromwell's prior performances at the Folger, as rustics and bumpkins, have never much tickled my funnybone. But he's perfectly splendid this time--playing a dapper, sporting chap in white ducks and cableknit sweater, slightly distracted, perhaps, but never too addled to forget to dust the edge of a planter before sitting on it. Actually, underplaying is the word here. Cromwell indulges in doubletakes, rolls his eyes, and puffs up cheeks that seem to be molded out of old cream cheese. But the comic effects are never forced. Cromwell is determined not to get ruffled, and his off-handed eccentricity gives this production a large percentage of its charm.

As his more volatile twin from Ephesus, Gregory Roberts is not so subtle in his attack. His accent is heavily British, but his temperament appears Latin, and his look is early Dolce Vita. But the two beleaguered servants, Lance Davis and Stephen Mottram, make a pair of good-natured clowns. Not all of their comic business pays off (their chauffeurs' caps do get overworked on occasion), but they both have a looseness about them, a what-the-deuce willingness to throw themselves into a gag, that comes to the rescue more often than not. As the distraught wife who doesn't know which twin is really her husband, Diana Van Fossen looms tall, although her acting, unfortunately, cuts her right down to size. Jim Beard, as the rotund Turk, gets good mileage out of every thwap of that fly-swatter, and Cecelia Riddett is entertainingly fussy, as a myopic spinster, who with delicious improbability suddenly discovers herself a love object.

Even when the performances are not quite up to par, though, Neville-Andrews' original view of Shakespeare's muddles manages to keep the evening bouyant. For all the color of this production--the pre-war finery, the fezzes, the veils, and the half-moon-shaped daggers--his eye is really fixed elsewhere: on discombobulated minds. The comedy doesn't come from the errors, but from characters who want to force them into a coherent pattern. What's really being mocked, and rather deftly at that, are our sorry claims on rationality in a world of double images and triple dealing.

THE COMEDY OF ERRORS. By William Shakespeare. Directed by John Neville-Andrews. Sets, Lewis Folden; costumes, Bary Allen Odom; lighting, Richard Winkler. With Timothy Rice, Gregory Roberts, David Cromwell, Lance Davis, Stephen Mottram, Jim Beard, Stuart Lerch, Diana Van Fossen, Cecelia Riddett, Anne Stone, Margaret Winn. At the Folger Theatre through July 11.