The song that plays during the dance scene at the end is "In My Veins" by Andrew Belle. This is the same song that underscored the highly emotional scene at the end of the season 4 finale "Always"- when Beckett finally gives in to her feelings for Castle, just as he gives up on her.
When Castle and Beckett are debating over their "song", he thinks it's been Bruce Springsteen's "Dancing in the Dark" since he got Springsteen to pull her on stage "Courteney Cox style" at a concert. He is alluding to Cox's appearance in the song's music video as the girl Springsteen pulls on stage to dance with.
Although they exchange stories about missing prom, in an earlier episode, Season 1, Episode 10 "A Death in the Family," Beckett talks about getting ready for prom and her date.
The use of cerulean blue as a clue is a reference to the "Pusher" episode of The X-Files wherein the character Robert Patrick Modell uses the phrase "cerulean blue" as a focus for his paranormal mental powers.