Marshall accidentally insults Lily when she admits to feeling unattractive as her body begins to swell from pregnancy.
He becomes upset when Ted invites Robin to a "Weird Al" Yankovic concert until Ted openly admits to feeling lonely and the sole reason he invited Robin was because he had already exhausted all his other friends and acquaintances.
This perspective causes Marshall and Lily to look more positively on the common traits they share with each other's parents.
Kevin and Robin go to the apartment, leaving Ted alone, where he meets a "Weird Al" fan who resembles his mother.
In the tag scene, "Weird Al" gets a fan letter from Ted in 1985 which gives him the inspiration for "Like a Surgeon".