The episode opens with Stan working on the machine. He rigs up some drums with toxic chemicals, as he exclaims how he does not care how dangerous it is. He sets off a timer, and syncs it up with another one on his wrist. A side effect of the machine is temporary gravity anomalies.
The next day Mabel shows Dipper a closet full of fireworks. Stan invites them to set them off on the roof. A heavily armored operator proceeds to tackle him, and Agent Trigger comes up behind him to signal the rest of the tactical team to secure the Shack. Worried and perplexed, Dipper and Mabel inquire what is happening, before they notice Agent Powers and Trigger, whom they thought had been eaten by zombies. The agents tell the children that an unknown person stole toxic chemicals the night before, and they suspect that the culprit is Stan. They then proceed to put Stan in their car, sending him away to be interrogated. They also take Dipper and Mabel, and inform them that they'll be going to child services.
Dipper and Mabel decide to clear Stan's name by finding the security tapes from the night before. They force Trigger's car off the road, break out, and head back to the shack. The agents try to interrogate Stan, but Stan insists on his one phone call. Stan uses it to talk to Soos through the walky-talky in his car. He tells him to guard the vending machine with his life. Dipper and Mabel return to the Mystery Shack, and after Dipper nixes Mabel's aggressive initial plan to attack the security forces guarding the front entrance, use Mabel's grappling hook to sneak into the attic. They find the security tapes in Stan's office, and review the footage. They are able to find video surveillance of Stan restocking the shelves. Seemingly proven innocent, they start to celebrate, when Stan suddenly leaves the shack. They fast forward the footage to see that several hours later, Stan, in full hazmat gear, is the one that stole the chemicals.
After realizing the truth, they find a hidden box in the office full of fake IDs and passports, as well as a newspaper clipping with a headline saying "Stan Pines Dead." Another clipping has a picture of Stan with a caption identifying him as an unnamed grifter. Mabel and Dipper, now totally unsure if Stan is really who they think he is, find a paper with the combination to the vending machine door inside the box. Meanwhile Stan manages to escape the agents by using a gravity anomaly being generated by the machine. After exiting the building, Stan misleads the agents hot in his pursuit by using the cash stolen from an agent's wallet to pay a taxi cab driver to act as a diversion and drive his cab as far away as possible from the Mystery Shack.
When government forces pull out of the Shack to assist in the search for Stan, the way to the vending machine is now clear. The twins head down to punch in the code, when they are stopped by Soos, who's been ordered by Stan to hold the vending machine, with his life if necessary. After a brief struggle, Dipper finally manages to input the code, revealing the secret bunker under the Shack. Inside Mabel, Dipper, and Soos find Stan's secret lab. Dipper, upon discovering the first two journals, is enraged at the fact that Stan has been hiding them and lying to them all summer. He puts the books together to form the blueprints of the machine. He uses his black light to reveal a hidden message by the author. They find out that, if the machine is activated, the entire universe could be destroyed. Dipper then finds out how engage the manual override.
Right when they're about to hit the override button, Stan shows up begging them not to push it and saying that he will explain. Dipper refuses to believe him, and then another gravity anomaly occurs, lifting everyone up into the air. Mabel makes it to the shut off button, with Dipper telling her not to trust Stan and push it. Stan begs Mabel to trust him, and attempts to approach her only to be restrained by Dipper and Soos. After another fluctuation pins them against a wall, Stan begs her again to not press the button, asking her if she really believes he's a bad guy. Mabel cries at the decision she has to make. Finally, Mabel tearfully decides to trust him and lets herself float away from the override, much to Dipper's dismay.
After the device activates, what seems like an explosion occurs and nearly destroys everything in the shack. When the light fades, the anomaly shuts down, with everyone seemingly okay, including the main characters. With the portal still functioning amidst the wreckage of the lab, a mysterious man with a rifle over his back walks out of the portal. He places his hand on the first journal, revealing that he is in fact the six-fingered man implied to be the author of the journals. Stan reveals that he is the author of the journals. The man removes his hood to reveal he is Stan's long lost brother. Mabel asks if someone should be fainting, then Soos replies that he'll faint and proceeds to do so.
In the end credits Stanford and his brother as children are quietly swinging on Glass Shard Beach as the sun sets.
- Written by:
- Directed by:
- Storyboarded by:
- Additional Written Material by:
- With the voice talents of:
- Kristen Schaal as Mabel Pines
- Jason Ritter as Dipper Pines
- Alex Hirsch as Stan Pines and Soos Ramirez
- Brad Abrell as Agent Trigger
- Jennifer Coolidge as Lazy Susan
- Nick Offerman as Agent Powers
- John DiMaggio as Manly Dan
- Linda Cardellini as Wendy Corduroy
- Will Forte as Tyler
- Kevin Michael Richardson as Sheriff Blubs
- Additional voices:
- Casting by:
- Manly Dan is a fan of Sev'ral Timez.
- The author is Stanford Pines' brother.
- Old Man McGucket is married to a raccoon.
- Grunkle Stan attended Glass Shard Beach Elementary and Glass Shard Beach High
- Soos wishes to be legally adopted by Stan and change his name to "Stan Junior."
- Grunkle Stan got A's in English, Math, and Science, and a D- in Physical Education.
- Every fingerprint on Stan's right hand is a double loop whorl.
- The title of the episode is an allusion to the cryptogram at the end of the opening sequence which states, "Stan is not what he seems."
- There are two framed photos that were taken in previous episodes. One is from "The Legend of the Gobblewonker" and another is from the Mystery Shack Grand Re-Opening for the town news in "Scary-oke."
- Among the conspiracy/evidence board the government agents compiled together is a Stan Buck first seen in "Summerween," a photo of a Stan Vac, and the flyer to the grand opening of the Wax Museum of Mystery from "Headhunters."
- Numerous prior episodes have alluded to the events of this episode and the existence and importance of Stan's brother.
- In "Headhunters," Stan's mourning of the decapitation of his wax doppelganger was alluding to the disappearance of his brother He is also initially shocked when he first sees the wax figure.
- During "The Time Traveler's Pig," Blendin Blandin's time watch (which Dipper and Mabel stole earlier) suddenly malfunctions from continuous overuse, and sends them back in time to near the Mystery Shack (then just a normal shack) in winter, before disappearing with a flash. The author sticks his head out of the door and looks out curiously before subsequently going back in with a shrug.
- In "Carpet Diem," Stan takes a lone pair of glasses, subtly without anyone else's notice from the hidden room, and cleans the lenses with a melancholy air when he's alone later on.
- In the end credits of the episode, Stan and his brother are on the same set of swings near the sea as the broken swings in Stan's Dreamscape and Blendin's suit malfunction.
- In "Dreamscaperers," a boy just like Stanford can be seen in the background of his flashback at boxing school, hiding his face behind a book.
- "Into the Bunker" reveals that the author predicted a catastrophic event and prepared enough supplies to last him several decades.
- In "Northwest Mansion Mystery," Old Man McGucket's calculations suggest an impending apocalyptic event occurring in less than a day, and Agents Powers and Trigger reference picking up a reading.
- Stan's altercation with Will E. Badger in his attempt to steal him from "Soos and the Real Girl" has been noted by the agents.
- Stan's failed self-made vacuum brand from "Dreamscaperers" is referenced.
- Glass Shard Beach, Stan's hometown, is alluded to again, as first seen in "Tooth" in Journal #3.
- The deed to the Mystery Shack is seen again.
- The nuclear waste used to power the Universe portal from "Society of the Blind Eye" is mentioned to have been stolen by Stan.
- Stan continues to sport the bandaged wound he first acquired in "Society of the Blind Eye," which was consecutively seen in "Blendin's Game" and "The Love God."
- Agent Powers and Trigger's survival of the zombie attack in "Scary-oke" is mentioned.
- Dipper's birthmark is seen again.
- Old Man McGucket's raccoon wife is the raccoon that McGucket mentioned that he kissed accidentally in his "weird, personal story" in "Land Before Swine".
- In the news article of Stan Pines, the number 618 appears again.
- Stan's prison number is 061800.
- The "Rock that looks like a face"-rock is seen again and argued about like in "Tourist Trapped."
- Robbie's signature Explosion muffin is on the Police station.
- Mabel uses her grappling hook again.
- Dipper mentions the Author's bunker from "Into the Bunker," and how similar the one from shack is to that one.
- In "Blendin's Game," Blendin steers his suit-watch, and two of the camouflages that appear are the Gravity Falls Police Station, and the beach seen during the ending credits.
- The graffiti "McSuck It!" that Lee and Nate spray painted on Old Man McGucket's shack in "Society of the Blind Eye" can still be seen.
- A scene similar to the one in the theme song is seen, in which Dipper and Mabel float off of their beds. A magic 8 ball can be seen in both the episode and the theme song
- The Authors notes about being betrayed about the pursuit of knowledge most likely alludes to the cryptogram in Gideon Rises which says "THE PORTAL WHEN COMPLETED WILL OPEN A GATEWAY TO INFINITE NEW WORLDS AND HERALD A NEW ERA IN MANKIND’S UNDERSTANDING OF THE UNIVERSE. PLUS, IT WILL PROBABLY GET GIRLS TO START TALKING TO ME FINALLY."
- The final event of the episode alludes to the cryptogram in Into The Bunker which says IMPROPER USE OF MACHINERY COULD LEAD TO UTTER CATASTROPHE.
- This episode is titled "The Return of Stan" in the United Kingdom and Ireland.
- Viewership: The episode received 1.6 million viewers on its premiere night, breaking that of "The Golf War record as the most viewed Disney XD premiere.
- The theme song was once again shortened due to a longer episode length. The whisper at the end was also different. It said "Not What He Seems."
- A countdown leading to this episode could be viewed at the fansite The Mystery of Gravity Falls, which was supported by Hirsch.
- However, due to the website's author not accounting Daylight Savings Time, the countdown was off by an hour.
- After the countdown finished, it was replaced with the image from "Ker-Prank'd," a gag in this episode.
- A page in Journal 1 suggests that the giant fissures in the cliffs of Gravity Falls aren't naturally occurring.
- According to the countdown for the portal, its anomaly pattern seems uncertain, but occurs at a time when the minute and/or second reaches zero, although not for all possible times.
- As with the rest of the series, certain scenes are animated specifically in the United States, rather than overseas in Korea. The scene in which the author was revealed was animated by Dana Terrace, although the keyframes were done by Matt Braly.
- Alex Hirsch gave the script of this episode to the winner of a Gravity Falls Toys video contest. 
- Alex Hirsch confirmed the identity of the author had been planned since the show was initially pitched to Disney.
- In the UK, the TV guide refers to this episode as "The Return of Stan," but this was a mistake and is not the actual title of the episode in the UK.
- In the code on the countdown website, the cryptogram "GRQ'W FRSB WKDW IORSSB" can be seen, which decodes to "DON'T COPY THAT FLOPPY." This seems to be a request to not duplicate the countdown website's code, as it refers to an anti-piracy PSA.
- In the promotional video entitled "Gravity Falls Police Station Audio: Grunkle Stan Discovers Something Cryptic (Part 3 of 3) has Stan discovering a message saying "JLGHRQ KHUH," which decodes to "GIDEON HERE."
- In the cold open, a page in journal #1 on the topic of floating hills has a symbol cipher that says, " 17px : ." Decoded using the authors symbol cipher to "MY COMPASS GOES HAYWIRE THE CLOSER I GET TO THEM DOES THIS MEAN WHAT I THINK IT DOES: THE ANSWER MAY BE UNDERGROUND."
- The license plates on the government vehicles all read "JXYDPHQW." Using the caesar cipher, it translates to "GUVAMENT."
- The end credit cryptogram reads "LAR ZPUHTFTY XWEUPJR GHGZT." When translated using the vigenère cipher, it reads "THE ORIGINAL MYSTERY TWINS.", referring to Stan and his brother.
- Keyword: STNLYMBL, the license plate on Stan's car.
- The page section revealed at the end of the episode says, "4-16-15-6-4-25 25-19-23-6-5 23-10-20 10-9-1 16-19'5 22-23-21-13." (left) and "4-16-19 11-25-54-19-6-25 15-10 4-16-19 11-25-5-4-19-6-25 5-16-23-21-13." (right). After using the combined cipher, it translates to "THIRTY YEARS AND NOW HE’S BACK. THE MYSTERY IN THE MYSTERY SHACK"
Click here to view this page's gallery.