The movie begins with Endsville, two weeks from the past as the Lord of Horror sends Billybot and Mandroid, two unrealistic robot replicas of Billy and Mandy, to the past to stop Mandy and Billy from obtaining Horror's Hand, a giant gauntlet which the Lord of Horror has himself. As Mandroid and Billybot leave through a vortex, future Billy and Irwin remember the old times and discover themselves too late to go through the vortex with the robots. Billy takes out his blueprints for a new time machine but Irwin points out that it's merely a drawing of policemen fighting dinosaurs (Billy states they should be working together). The duo decide to make a time machine while the audience must guess where Mandy or Grim is in the future.
In the past, Grim goes to reap General Skarr, who first thinks Grim is the TV repairman. He discovers the truth when Grim sends the TV into a vortex. It turns out that somehow Skarr has a hole through his stomach. Grim discovers Billy and Mandy in the room as well. Mandy claims that the two are bored and want to go with Grim to work. Grim refuses and Mandy claims that since Mandy won Grim in the game of Limbo, Grim has to be their best friend, and any best friend would take their other friend to work if the friend had a cool job. Skarr makes a run for it in his modified car and Grim and the kids chase Skarr using Grim's scythe as part broom and part car. While Grim argues with the kids, they crash into a gas station, causing a petrol meter to fall on Billy's head. They then crash into a fireworks tent having fire crackers in their clothes and mouths. They also end up turning over an oil truck. Later, Skarr even uses oil slick which merely causes the scythe to scrape the ground igniting a fire starting in the oil and following the group. Skarr then sends a heat-seeking missile at them. Skarr finally moves into the ocean by turning his car into a sub and happy that he cheated Death. Skarr notices a button and pushes it, then realizes that the button was what shot a laser through his stomach in the first place. The group discovers the oil truck behind them and the small fire coming. When the fire hits the oil truck, everything explodes with addition to the fireworks, all in an apocalyptic manner. The angry group comes home to Billy's house, burnt. Irwin comes in dressed in a bear suit trying to woo Mandy but fails. Mandy slams the door on him and is surprised when Irwin is sitting on the couch. Suddenly, the Underworld police break in and send Grim to court.
In court, Grim discovers that he's charged for abusing his powers. The jury is split up in pairs and each pair sits atop a giant pillar that looks like a gorilla arm. The jury includes Dracula, Bride of Frankenstein, Wolfman, Fred Fredburger, the blue juror annoyed by Fred, a mud ghoul, Darth Vader, The Invisible Man, and about two other citizens. The fly guard is also seen. Of course, Judge Roy Spleen is judge as he sits in the flaming mouth of a giant statue head. To everybody's surprise, the Boogeyman is the prosecutor. In the end, Fred Fredburger finds Grim and the gang innocent. But later, the blue juror states that the paper reads guilty. Boogey has the kids and Grim in custody onboard the Boogey Bay, along with a few supernatural pirates and Boogey as captain with his first mate, Mr. Creeper. Numbuh 3 (guest starring as an evil being trying to reap parents from the KND) becomes the new reaper, Boogey stating that she's on a six-week trial period.
Meanwhile, Billybot and Mandroid go to Billy's house where they attempt to get information out of Billy's dad. The androids find nothing and Billybot gets damaged after drinking root beer and malfunctioning, making his head fly off, after which he lights on fire. Boogey's ship makes its way to the Dead Sea, where Boogey plans to feed the gang to lava sharks. Boogey reveals his plot to steal Horror's Hand and use it to be scary again, then he'll scare every kid in the world through their dreams, and all would vomit at the mere mention of the name "Boogeyman". But first, he must conquer his worst fears to own the Hand. Boogey sends Billy first to walk the plank, then Billy states that he's not scared as long as the sharks don't eat him and starts singing. Along with the song, Mandy and the rest of the captives make a run for it.
Boogey is first to go through the gate to Horror's Hand and claims that Billy and Mandy must go through the Gatekeeper to go through the gate, so Boogey uses the Gatekeeper's magic eye to witness the team's demise. The group sets out to stop Boogey and claim Horror's Hand; Mandy wants to rule the world with the hand, Irwin wants to woo Mandy with the hand, Billy wants to buy a candy bar, and Grim could reclaim his role as Grim Reaper and get his scythe back. The group meets a blind cyclops with an eyepatch. The cyclops sends the gatekeeper, a giant orange cyclops, to go test the children and demands they bring their greatest riddler. Irwin offers to step up, and the gatekeeper smashes Irwin with his club. The test is actually a taste test as the gatekeeper puts the group in his mouth to see if they taste good. After they pass, the gatekeeper puts the group into a soup to wait for them to cook. Mandy tricks the cyclops into thinking Billy tainted the soup, then Billy reveals he actually did and the gatekeeper throws them out. Mandy jumps out and steals the gatekeeper's eye, then there's a fight for the eye that ultimately leads to Billy eating it. Creeper offers to build Billybot and Mandroid and shows Boogey the blueprints, when suddenly the Billybot and Mandroid from the future teleport into the ship. Mandroid offers to help Boogey and Creeper destroy Billy and Mandy.
The group run away from the Cyclopses' Cove and discover a giant cake as they run near the getaway ship. Mandy is suspicious, but a crazy Irwin and Billy stuff the cake into Mandy and Grim's mouths. Suddenly, they fall into a deep slumber. Mandroid comes out of the cake and reveals that Billybot laced the cake with a sleeping potion, when due to his newfound stupidity Billybot eats the cake and dreams he is a pygmy marmoset. Now asleep, the team is vulnerable to dream infiltration by Boogey. They have a hive mind dream, where Billy dreams he is the world's fastest cowboy/astronaut, Mandy and Irwin relive The Pit and the Pendulum for the thousandth time, and Grim dreaming about being mayor of Puppytown. Billy is confused about who's the real Grim, the fancy-dressed Grim or the horse Grim from Billy's dream, when the horse Grim is revealed to be Numbuh 3 on charity work for "The Stupid Kids' Dream Foundation". When Boogey's attempt to scare the group fails, he materializes and kidnaps Mandy then snaps his fingers causing the ground to disappear, after which Billy states he usually doesn't wake until he wets himself. Irwin begs him to do so, after which the remaining protagonists wakes up.
On the Boogey Bay, Mandy is tied to the figurehead and Boogey offers Mandy his hand in friendship. Mandy refuses, then finds herself going through multiple bizarre nightmares in effort for Boogey to break her will. Boogey laughs as a mad Irwin storms in and beats up his henchmen in a fit of rage. Irwin kisses Mandy, who awakes to Grim's and Billy's utter disgust. Mandroid comes in and threatens them with a laser rifle, when Mandy is disgusted by how unrealistic Mandroid is, stating she does not take orders, she does not assimilate, and she does not listen to Boogey, which causes Mandroid to malfunction. Mandy takes the laser and shoots a stalactite down, stopping the pirates from attacking and the group make a run for it on the deathboat and go in the lead to the Island of Peril, resting place of Horror's Hand. Boogey sends the Kraken to go after the four. They climbs up the long stairs of the temple and meet Horror the Ancient and his severed left hand at the top of the temple. Horror states that he channeled all his fears into his left hand and cut it off in order to become courageous, but new fears came so he now just plays on his computer and learned how to play a guitar with his teeth. Boogey comes in and the Kraken engulfs Billy, to everybody's horror. Horror states in order for two parties to compete for the hand, they must hold the Cannibal Run and the winner will have to fight Horror and then receive the hand.
Boogey's ship gets a sea monster tied to the ship for extra speed, and Mandy, Grim and Irwin must race in their deathboat without Billy. Mandy shows a sign of weakness before Billy resurfaces and reveals he lived by breathing his own farts and also made friends with the Kraken. The race starts and the team go through the Glacier of Doom, which grows a face, and Mandy destroys the glacier with the laser rifle. They go through the Hole of Oddities, where they become live-action puppets, the Sunken City of the Sea Witch, where they get by the sea witch by using Irwin's glasses to redirect her magic laser to turn her into a frog, the Picnic Grounds of Terror, and the Corridor of Blades. The heroes win and easily defeat Horror by Mandy taking Billy's nose and throwing it at Horror.
The heroes attempt to face their worse fears: Billy's fears of spiders, clowns, and the mailman, Irwin's fear of telling jokes to wild bears and accidentally insulting them, and Mandy's fear of growing up to lose her evil ways and marrying Irwin. But Grim is the only one who conquers them as he lives his worst nightmare every day: living with Billy and Mandy. Boogey steals the hand and uses it to destroy Grim, but is then defeated by his worse fear: discovering that he's not scary. Grim later reveals that he turned the Hand off and Boogey now is living his life in his fears forever.
The police and Judge Roy Spleen come in, but Mandy convinces and threatens the judge, so Judge Spleen decides to offer Grim's job back with Numbuh 3 fired. Grim decides to put the Hand in his trunk. Irwin states now he can use the hand to make a certain someone like him, and Billy can scare people into thinking he's smart. They start fighting over the Hand, then the team somehow learns a valuable lesson when Fred Fredburger says the nachos he ate hurt his stomach, yet if he didn't eat them he would've never known he could finish them all. Grim saved the world even without the scythe, Mandy is still mean and demanding even without the Hand, Irwin finally got to kiss Mandy, and Billy is getting a new bike for Christmas. Mandy hides the Hand behind her back, when to everybody's surprise, future Billy teleports in the temple and reveals that Mandy is planning to steal the Hand and become the Lord of Horror in the future. Mandy merely shrugs and gives the Hand back to Grim. The group returns home with Future Billy saying his farewell. Mandy has a fleeting moment of empathy for Grim, before ordering him to make them hot dogs. Meanwhile, Billybot and now more realistic Mandroid order Creeper to serve Billybot's drink. Billybot drinks the root beer and his head explodes again.
After the credits, future Billy goes back to his own time only to discover that nothing has changed, and that the Lord of Horror is now Fred Fredburger.