Don't let it be said that Ted doesn't learn from his mistakes. Ted learns from his mistakes. This is why he decides he's going to give his sister the briefcase early. This is why he decides he's going to sign the lease.
Ted makes mistakes, apologizes for them and doesn't make them again. At least if he's doing it right, and Ted really likes to think he is.
So he learns from his mistakes. That's why he waits until he's alone with Barney, with Lily on her way home and Heather upstairs, before he shoves Barney against a wall outside of MacLaren's, in no way as hard as he could. "You kissed my mother?"
"Might have!" Barney squeaks in surprise and then coughs. "It was a very confusing moment. Lots of confusion, I was checking over my shoulder and your mother was leaning over for something in her bag and it was a completely meaningless brush of lips!"
"Where the hell was her bag if leaning over for it means you kissed her? She sits with it in her lap!"
"Yeah, she might have dropped it to the floor on my side of the car." Barney admits and Ted takes a step towards him. "I didn't let her pick it up, Ted! She's your mother. After the completely accidental brushing of lips, I - I pushed her back and I said 'Ted Mosby's Mother, stop! I respect your son too much to let you think that was anything but accidental and live under the delusion that the feelings I have for you are anything but what any Bro would have for their best Bro's mother.' I swear, that was where it stopped, Ted."
"On my entire porn collection, that's all." Barney swears and once Ted doesn't make any more threatening moves towards him, he adds, "For what it's worth, Ted, I totally won't mind if you kiss my brother to balance out. Bro justice."
"Yeah, Barney, I think your brother's husband might mind." Ted reminds him and backs off, nearly bumping into someone on their way into the bar. "And what, I don't get to kiss your mother?"
"Yeah," Barney says, "If you can dig her up and you're into that, sure."
"What would I even do with your stupid porn collection?"
"Um, be awesome?" Barney suggests and Ted shakes his head at him as he heads upstairs, but not quick enough for Barney not to shout up after him, "Maybe get laid for once!"
It's three-thirty in the morning when Barney sends the message ted r u awake?
Ted rolls over and tries to go back to sleep, but it's barely been a minute before he gets another text message.
no srsly, ted. need 2 tlk bout ur mom.
fuck off Ted texts back and shuts his phone off, because seriously, he's not doing this at three-thirty.
He's not really all that surprised though, when he rolls over in his sleep at six only to end up pushing his face into Barney's shoulder. Barney has randomly appeared in Ted's bed before, though as Ted sits up, he's a little surprised that Barney's asleep and doesn't smell like he's bathed in alcohol. "Barney, doesn't this work better if you're staring at me creepily when I wake up?" Ted asks, and shoves at him as he realizes something. "You're not dressed. Should I be worried about my virtue?"
"If you have any virtue left, you should fire me from being your best friend." Barney mutters and doesn't really wake.
"Actually, Marshall's my best friend." Ted yawns and yeah, that wakes Barney right up. "Why aren't you wearing any pants and is that my shirt?"
"You really think I'd ruin my suit just to lie on your bed? Ted, that suit is expensive." Barney sighs and Ted hears the disappointment that Ted still doesn't know his suit fabrics yet, and doesn't care.
"So why were you sleeping and not staring at me in the hope that by freaking me out first thing in the morning will make me tell you whatever it is you want to know?"
"I tried, but you just covered your face with the pillow and well - I think you said 'fuck off' but with the pillow it kind of sounded like 'suck off'." Ted can't help but give Barney a look, because you really never know with Barney. "Anyway, long story short, your bed is comfortable and I fell asleep."
"And why were you in my bed in the first place again?" Ted asks, and wishes he'd left Barney alone in favor of sleep for another two hours at least.
"There was --" Barney hesitates for a second. "Oh, there was nothing."
"So you came over in the middle of the night just to sleep in my bed? Aren't you too old for those kind of nightmares?" Ted asks, and reaches over Barney for his phone and finds the message. "Okay, you mentioned my mother. I thought we were done with that."
Barney stares at him for a moment and sighs. "It wouldn't be Bro justice because the Bro Code says nothing about brothers."
"I'm sorry, what?" Ted asks, surprised into laughing. "Barney, did you seriously go through this entire thing just to tell me that for Bro justice to be done I have to kiss your dead mother?"
"I didn't write the code, Ted." Barney tells him. "But the code clearly states sisters and mothers. Your apparent willingness to kiss my brother has created a problem."
"My - my apparent willingness to kiss your brother? What -- He's married and he's adopted a son!" Ted hisses because his sister is sleeping on the couch, and he has a feeling this is a conversation he doesn't need her listening in on. "Oh wait, I know what this is - you're freaking out because I didn't say I wouldn't kiss your brother because he's a guy."
"No, Ted, this is not about your lack of protest against the kissing, this is about you not telling me." Barney spreads his hands and looks shocked. "Me! Your best friend."
"Well, actually --" Ted starts, but at Barney's look, changes his statement into, "Did you ever ask?"
"I think that in the years we've been best Bros, I've asked you if you--"
"No," Ted shakes his head. "You didn't, because I always said if someone asked, I'd tell them the truth."
"Ted, I'm your wingman. Rule number uno of wingmen is to know your bro's preferences." Barney says and continues looking like Ted's killed his puppy. "Which means you lied to me, Ted Mosby. Me, your --"
"Best friend," Ted finishes for him and sighs. "Fine, maybe I, in some rare mental state I've never been in before, went against my word and omitted parts of my sexuality because I was unsure of your reaction and for some bizarre reason cared. I'll beg your forgiveness later, but now it's six thirty and it's Sunday and I just want to sleep, Barney. So I'm using Marshall and Lily's pause button, and we'll continue this later. After sleep."
"Uh, the fact that it is Marshall and Lily's pause button, means it doesn't work for us." Barney points out, "Besides, there's something I should tell—"
"Yes it does, and I'm using it. Pause." Ted interrupts and lies back down on the bed, eyes pointedly closed. Which makes it really easy for Barney to lean down a few seconds later and encourage Ted to use the pause for other, better and more sweaty things than sleeping.