When Barney is citing the Bro code he states that article 89 as "The mom of a Bro is always off limits, but the stepmom of a Bro is fair game....." This is actually article 104, not 89. Also, by saying these codes in front of Lilly and Robin, Barney is in Breach of article 4, which states "A Bro never divulges the existence of the Bro code to a woman".
The pink dress worn by one of the wenches in Barney's fake history lesson is the same dress worn by Buffy in the Halloween episode of the 2nd season of Buffy the Vampire Slayer, when everyone is turned into their costumes. Alyson Hannigan (Lily) starred on that show playing the character Willow.
Lily asks Robin if Barney is shaved down there. Lily already saw Barney naked when she painted him so she should already know.
Ranjit rants at Barney for sleeping with Robin in Persian (Farsi). He says "na mard, na looti, na rafigh; akhe age oon doost dokhtare man bood ke..." Roughly translated, this means: "Inhuman, traitor, non-friend; if she was my ex-girlfriend, I [sic] would put my hands around your neck..."