Perhaps the ultimate example is "Oh Dance, Baby", where Bret starts singing karaoke, entirely in Korean, about the difficulty of being in love. Or something.
The karaoke number is a reference to an earlier joke in the episode, where Murray got the guys an off-screen "gig" at open-mic karaoke night.
Interestingly, Mushroom Samba song Prince of Parties is not one: in fact, it is actually probably the only song in the series that is directly referenced in a later episode: "If you party with the party prince, you get two complimentary after-dinner mints!" sings Bret, wearing the costume from Prince of Parties, in the second-season song Sugarlumps.
That's a BLAM referencing another BLAM... so meta...
Alternatively, all the sudden song numbers exist in the same alternate reality...
The wallpaper-skin reference from Freaky is shown to have actually happened shortly after the song ends.
Ear Worm: Too many to list. Everyone has their favourites.
In the song "Hurt Feelings", Jemaine laments about how his family forgot to call him on his birthday. His next line in the song is "The day after my birthday is not my birthday, mom." At first, this just seems tragically hilarious. However, New Zealand is 17-18 hours ahead of the USA's east coast. Ergo, she actually called him two days after his birthday!
Upon listening again, you may realise that the rhyming structure of the song "Carol Brown" actually foreshadows the episode's ending! Keith was nothing but a thief.