The British actor-comedian Steve Coogan is tall, with tousled Byronic hair, eyes that light up like sparklers, and a merry, wolfish smile that would be even more dashing if it weren't a bit lopsided and didn't carry a hint of Tiny Tim's leer. There's a distinct promise of insanity in that grin. Coogan looks like some long-lost member of the early Beatles who, with a loosening of a screw or two, could easily turn into Sweeney Todd. On American movie screens, most of the characters he has played have been scathingly blitzed showbiz narcissists, like the frothing-at-the-mouth indie-rock impresario of 24 Hour Party People, the obscenely vain movie star of Tristram Shandy: A Cock & Bull Story, or the flyweight director in Tropic Thunder. (Better yet, there was Coogan's bristling and magnificent comic turn as yes Steve Coogan in the one immortal segment of Jim Jarmusch's Coffee and Cigarettes.) Coogan has portrayed his share of egomaniacs, all right, but he has never done egomaniacal failure with the loopy gusto and sheer fearless squirm-inducement he brings to Hamlet 2.
In the opening moments, we see him in a pair of fake television commercials that are every bit as hysterical as the fake trailers that open Tropic Thunder (he's especially funny as one-half of a strolling, sunshiny couple in an ad for a herpes medication). What's he doing in these late-night spots from hell? They're the career highlights of Coogan's Dana Marschz, a brutally untalented actor who has become a self-loathing high school drama teacher in Tucson, Ariz. Despised by his wife (Catherine Keener, at her most scalding), he's also a walking punchline to everyone at school students, administrators, a brainy shrimp of a junior drama critic all of whom can see that he's a dismal, sweaty, emasculated failure. It's written all over his face.
But that isn't the only thing written there. So are delusions of grandeur, fear and hysteria, and a tear-streaked quivering joy that verges, at times, on the psychotic. Dana is a loser who thinks he's an artist, and Coogan plays him as a man who can barely make out what's in front of his eyes, so blinded is he by the hallucinatory glow of his ego-mirage. The more sincerely Coogan gushes, the more he seems to be taking stage cues from tiny voices in his head. Accidentally bashing one of his students with a wastebasket, Dana turns around with a gleeful smirk and says, encouragingly, of his mistake: ''It was stupid, but it was also theater!'' Dana wants so badly to connect that he turns his whole life into theater. When it's announced that the drama department will be permanently axed from the curriculum, he decides to fight the move by mounting one last, singular production, writing and staging a rock-musical sequel to Hamlet, in which a time machine returns the great Dane so that he can save himself and everyone else in the play. The brain-bogglingly terrible show also features Jesus, Star Wars, the Gay Men's Chorus of Tucson performing ''Someone Saved My Life Tonight,'' and Dana's lifelong conflict with his own father.
As a movie, Hamlet 2 is lively, energetically daft, and very, very scrappy a broader, more loony-tunes knockoff of Waiting for Guffman that takes the thespian-loser hero and let's-put-on-an-awful-show tastelessness of that Christopher Guest classic, blends them with a satirical travesty of inspirational-teacher movies, and then throws in a token tweak of conservative values. It must be said: The movie combines these elements so randomly that it's like something tossed together at a suburban salad bar. In its farcical craft and tone, Hamlet 2 keeps slipping and sliding around, but as a pedestal for the riotous beyond-shame theatrics of Steve Coogan unhinged, the film is often dementedly hilarious. He mugs, he glowers, he hams up the telling of jokes too corny-horrible to print, he mocks and vamps like a venomous drama queen. As its opening night approaches, the show begins to inspire local controversy, since it is offensive not to mention nuts in almost every way. Yet when Hamlet 2 finally goes up, songs like ''Rock Me Sexy Jesus'' give off such a happy blast of cluelessness that the show becomes almost innocent. It's stupid, but it's theater. It's also a high school musical that would make John Waters proud. B+