There's an old showbiz adage that directing is 90 percent casting, and that's also true of casting the directors themselves. Take "Bad Words," the directing debut of actor Jason Bateman.

With this same script, cast Adam Sandler in the lead instead of Bateman, hand the reins to actor-director Dennis Dugan (responsible for eight Sandler movies), and you would get a steaming pile of feces, guaranteed. And yet, in the hands of Bateman, "Bad Words" becomes a diverting enough outing, one that's disposable but enjoyable.

Ironically, Andrew Dodge's script was a fairly hot item, having appeared on the 2011 Black List of best unproduced screenplays. It's not hard to figure why. "Bad Words" fits a certain indie comedy formula that's likely to turn a profit, pitting cynicism against a cute kid on the way to a victory for sentiment. Call it "Bad Santa" meets "Little Miss Sunshine."

Bateman plays 40-year-old Guy Trilby, who sets aside his job of proofreading product warranties to pursue a mission of Ahab-level obsessiveness. For reasons known only to him, Guy takes advantage of a loophole to compete in spelling bees, taking it all the way to the annual, national "Golden Quill." As he shamelessly competes against eighth-graders, Guy fends off queries from all corners, including those of his journalistic sponsor Jenny Widgeon (Kathryn Hahn) of the blog "The Click and Scroll."

Guy has natural enemies in parents, the bee's administrator Dr. Bernice Deagan (Allison Janney) and the sourpuss President of the Quill, Dr. Bowman (Philip Baker Hall). But in his bitterness (and with his eyes on the prize), Guy also picks fights with his bemused young competitors, shamelessly intimidating them out of his way and batting away any inkling of friendly sportsmanship. That kind of behavior cannot deter sunny 10-year-old Chaitanya Chopra (Rohan Chand), an adorable nerd -- clutching a beloved study binder he's named Todd -- who breaks down Guy's defenses to forge an inappropriate friendship.

This sets the stage for plenty of "Bad" antics, partly played out in a rap-scored montage of drinking, shoplifting and vandalism (precursor to a junior sexual initiation of getting flashed by a full-figured prostitute). The predictability of these shock tactics, as well as Guy's race-baiting (the nickname "Slumdog" and a reference to the kid's "curry hole"), makes much of "Bad Words" more or less impressively nasty more so than it is funny. Worse, "Bad Words" doesn't seem to know what to do with itself once it gets where it's going, leading to a resolution that's limp at best.

And yet, it's hard to throw on the trash heap. Because Jason Bateman. The star, riding a career resurgence that began with "Arrested Development," has honed a comic sensibility defined by subtlety and sharp comic timing. As Guy, he wears a haughty expression and a lifted chin to cultivate an imperious, "back off" air, and as an actor-director, Bateman knows how to get and select the best performance moments from national treasures like Hahn and Janney as well as child-actor Chand.

If you can get with vile behavior as being all in good fun, there's just enough dark comedy in "Bad Words" to spell a good time at the movies.