One of the most jaw-dropping things we witnessed at the movies this year took place before the movie started. Attached to “Scott Pilgrim vs. the World” was a trailer for a claustrophobic thriller in an elevator. It’s doing a pretty good job of selling itself, and then a title card comes on that says, “From the mind of M. Night Shyamalan.”

The audience burst out laughing. Wow.

Granted, the man’s output since, well, 2000’s “Unbreakable” has been spotty at best – and his other 2010 release, “The Last Airbender,” was terrible – but to laugh at the sight of his name? That’s just cold, and “Devil” never recovered from the association, settling for $33 million at the box office. That’s triple its budget, mind you, and therefore a financial success for the studio, but it is still viewed as another failure on Shyamalan’s resume.

But here’s the thing – it’s actually a decent movie. One wonders how much better it would have done had Night’s name not appeared in the trailer or the credits. That’s a terrible thing to say, but hey, we didn’t make those people in the audience laugh when his name came up.

Detective Bowden (Chris Messina) is investigating the death of a hi-rise jumper in downtown Philadelphia (natch). The case leads him to a nearby building, where more trouble is brewing. Five people are trapped in an elevator, and as Bowden gets to know their back stories, he finds that each of them has a checkered past. As lights flicker and people start getting hurt, everyone is on edge, but only the superstitious elevator security monitor suspects the truth: that the Devil himself is in there, ready to claim a soul.

The biggest knock on Night since his breakthrough is that he’s a better director than he is a writer, that his reliance on the twist undermines his visual accomplishments. “Devil” gives that notion a good kick in the teeth, though the story isn’t without its flaws. It’s always a warning sign when a movie only uses narration at the beginning and the end – it speaks to a lack of confidence in the storytelling – and “Devil” succumbs to this as well, even though it really doesn’t need to. Night’s story, which was adapted by “Hard Candy” screenwriter Brian Nelson, is wisely stingy with the facts and the limits in terms of communication (the authorities can see and communicate with the passengers, but the passengers can’t communicate back), and while he can’t resist the urge to use yet another twist ending, this one actually works, even if you have a 20% chance of guessing it right before the (awesome) title sequence is finished rolling.

So yes, Shyamalan is down, but if “Devil” is any indication, he’s not out. If we’re lucky – and he’s smart – he’ll head down this road again before making another star-studded mess like “The Village.”

Click to buy “Devil”