Robin asks Lily about where Ted got his red Cowboy Boots in the flashback where the gang is in Barneys Apartment, but it was shown earlier (s6e21) that Robin was with him when he bought them.
The girl Ted brings to Barney's apartment disappears after the lights go out and no explanation is given to why she is not there anymore.
However, she told Ted she had a boyfriend and that she lives or came from another room in the building. She wasn't trapped in the room so could have left at any time.
When the power goes out in Barney's apartment, the lights in the rest of the city in the background stay on.