Mac states "we did have a black president before the orange one," referring to Barack Obama and Donald Trump. At the time of filming the election had not yet taken place so they had an alternate line where Mac said, "We did have a black president before the woman, " in case Hillary Clinton won.
Charlie Day wrote all of these songs and apparently did all in one night
Dennis' remark, "We don't give a shit about your dream", is a possible call-back to the first episode, The Gang Gets Racist (2005), in which Dennis stops Dee from telling him her dream by interrupting, "I hate listening to people's dreams. It's like flipping through a stack of photographs. If I'm not in any of them and nobody's having sex, I just . . . don't care."
This episode pays homage to, and references, a few different films and TV shows--The Wiz (1978), Quantum Leap (1989) and a slew of different body swap movies (The Hot Chick (2002), 13 Going on 30 (2004), etc.).