In the scene where Bart goes through several files in Chief Wiggum's police closet, he briefly shudders when he finds the file for "Terwilliger, R."
In the end credits it says that this episode was dedicated to the memory of Sunni Walton O'Neil, an animator for The Simpsons.
When Bart looks through the police records, he finds Homer's and comments, "Wow, Homer's been in jail six times." Originally, the line after that was, "Aw, he killed a swan at the zoo," but the line was changed to "Aw, Mom's only been in jail twice." The resulting line change raises questions of how Marge's arrest information can be on Homer's police record.
Bart's line about Marge being in jail twice is a reference to the season three episode "Homer Alone" (where Marge was arrested for obstructing traffic after having a nervous breakdown and stopping her car in the middle of the road) and "Marge in Chains" (where Marge is put in jail for absentmindedly shoplifting bourbon).
This episode is similar to season four's "I Love Lisa," in which a Simpson kid is friends with Ralph Wiggum.
When Skinner is introducing the robot to the class, Bart's desk is in the middle of the room. When Bart throws the apple to the man in the tree, he's sitting next to the window. He had plenty of time to move to make way for the robot.
When Homer is playing the "Let's Make a Baby" video game: the announcer says "You are out of sperm." The closed captioning reads, "Your score is zero."
When the Simpsons are at the museum, Bart says he's going to go toss the virtual salad, but the closed captioning says "I'm going to crawl inside the Invisible Frenchman."
Bart, Lisa and Homer know some of the things in the Knowledgeum (such as the virtual salad, the giant book and the sex education computer) despite that they've never been there before and the place just opened. They could have looked at a brochure prior to their visit.
Bart has played with Ralph in the past, as seen in "Homer at the Bat" and "Bart's Girlfriend," so why would be adverse to going on a playdate with him? And even if he were, he could have just said "no thank you".
Bart was stuck in Ralph's Chinese finger trap at the end of act one, but at the start of act two, Ralph got the finger trap stuck on his tongue. It may have came off and Ralph wanted to taste it.
Ralph doesn't need a bunkbed, as he's an only child, meaning that Bart should have taken a sleeping bag with him. His parents may have sold his old one and bought this new one especially for that occasion.
Bart and Ralph went into the toy store but there would be alarm lasers.
When they are at the prison, the prison is on a island, but when firing the rocket, it is right in Springfield.