Al Molinaro suggested Robin Williams for the role of Mork after the original actor left. As such, producer Garry Marshall invited Williams for an audition interview and the young comedian demonstrated his quirky comic talent immediately by sitting on his head when asked to take a seat. At that kind of inspired comic silliness, Marshall immediately cast Williams and later remarked that it was because he was the only alien who auditioned.
When Robin Williams was cast, the comedian quickly impressed the cast by improvising much of Mork's character on set. It got to the point where cast members were running about shouting "He's a genius!", the writers came on set to take notes of Williams' improvisations and TV network executives came to see what the fuss was about with this newcomer. The last group was so stunned at Williams' talent that the actor was signed on for his own TV series, Mork & Mindy (1978), just four days later.
In 1977, Garry Marshall's son Scott Marshall was, like many kids his age, obsessed with Star Wars: Episode IV - A New Hope (1977). He suggested to his father that it would be funny if Fonzie met an alien. This provided the genesis for this episode.
When Mork is watching The Andy Griffith Show (1960), he remarks, "I like that boy, Opie." Opie, of course, was played by Ron Howard, who plays Richie Cunningham here. Going by the established Happy Days chronology, this episode took place in 1960, the year "The Andy Griffith Show" premiered. Andy Griffith's character Andy Taylor previously appeared in the backdoor pilot Danny Meets Andy Griffith (1960), just as this episode served as a backdoor pilot for Mork & Mindy (1978).