Ok LIL, you asked for insights, so here's what I've got. Sorry if they're harsh, but I'm NOT going to gaslight you.
Online flirting, especially after years without the rush of hormones that you get when you're at the start of something new, or have the possibility of starting something new, is highly intoxicating. When I got back out there via OLD (online dating), man was that a RUSH! It was like a long drink of water after years of being in a desert and not even realizing you've been thirsty for a long time. Is it something you can compete with? Sorry, but no.
Suddenly I was the hot new thing, and I hadn't been hot or new for over 10 years. What an ego stroke it was, and I had a LOT of fun flirting online. But after a short time, it gets old and frustrating when you realize most men are dogs that only want to get you into the sack. You feel objectified and diminished as a person, because most men have no problem treating women like sex objects. Are you a better option than that? DEFINITELY.
But realize that she's going to have to go through that before she wises up. She may become addicted to the high and not mind being objectified. A lot of waywards do. (My XWH is still addicted to the high of the chase, and I doubt he'll ever change.) But if she's smart, she won't take that shit for long, and you become a very viable option to her again.
Keep your side of the street clean from here on out. If you've done or said things out of fear and frustration that you regret, apologize. Don't explain why; that'll just make you seem weak. Just show her that you're a man of integrity and you will always treat her with the respect she deserves (even if her actions in the current situation don't necessarily warrant that respect). She's the mother of your children and not a complete shit show (that anyone but she can prove right now), so treat her with the same respect you would if she wasn't pulling these shenanigans.
For God's sake, stop telling her how important she is to you and that you love her and all of that mushy crap. It's only not pathetic if you're sure she's 1000% into hearing that kind of romance. SACK UP and be a man. A cautious man that'll do anything in his power to protect himself.
Stop complementing her. Your compliments don't mean anything to her. And they make you seem weak. Stop doing sweet things. They don't mean anything to her and they make you seem weak. Just KNOCK IT OFF and do nice things for yourself. Be as kind and thoughtful of yourself as you've been to her. YOU are now your #1. Your boys are your #2. Take your boys to the next big game, and leave her at home. If she complains about being excluded, reply that you and the boys need some male bonding time. It has nothing to do with her.
Stop worrying about how you'll rebuild if it all goes into the crapper. Yeah, I hear it; it's easier said than done. But realize that you're capable, and intelligent, and bring a lot to the table to a potential new partner when you're not busy being a basket case panicking over the loss of one woman. You know what? If it comes to that, you'll rebuild your life because there is no other option. It'll suck BAD for a while, but you will do it. I had a hell of a lot less when it came my time to do it, and I got through it. You can too.
I know this is completely counter-intuitive, and it's already been said a bunch of different ways in this thread, but you need to pull away from her.
This is just an idea that I haven't thought all the way through, so take it with a heavy dose of skepticism: If you're going to discuss something with her, tell her that you think it may be best for you to separate for a while so you both get time and space to think and process. No contact outside of co-parenting. No playing house any more. But you refuse to be in a marriage where both partners aren't sure they want to be 100% in on. And since she's not all in, she has to be the one to go. Her reaction will be very telling.
Let her know that this is what you need in order to possibly build a new relationship with her, which is really the only chance you see of this whole thing working out. Tell her you'd like to give it X months (come up with a number there) and then you can check back with each other to see if you'd be interested in dating and starting a new relationship with each other. Then STOP TALKING and see what she has to say.
And for God's sake, stop thinking that it's way too late to be starting over. I'm 56, and having the absolute best time of my life right now. My future is so full of possibilities! (And I'm hoping that those include the 6'4" hottie that I'm dating and soooo very into.)
You will be OK, regardless of how it turns out. This will not break you unless you want it to, so knock off the self-pity and get going.