They are playing around with the timeline a bit. For all we know Barney left his hotel room the exact same time that Lily stormed off and Ted was out on the balcony listening to The Mother play her song.
Arrested Development Season 4 played around with time in a similar (albeit more elaborate) way by having all of it's episodes more or less take place around the same time.
You're right. Remember that in "How Your Mother Met Me", Ted came back into the room to discover the missing Barney right after he heard The Mother sing. They had that montage of all the characters that night as she sang. So presumably it all took place at the same time.
I can't remember, but did Tim Gunn say he was going back to NYC while at the poker game? I just assumed he was sticking around for the wedding.