Here's my advice to you: Consider this incident your wake-up call. It's time to try to reconnect with your wife, try to remember why you married her in the first place and see if you can bring some of that back. I'm sure she'll be happy to help you as long as you're honest with her about wanting to reconnect and that you feel you're drifting apart. ...not about the "almost cheating on her" thing. That should probably come later, when your relationship is more stable... or when (not if) she finds out about it, whichever comes first.
Whatever else you do, give this your all. Pour everything you are, everything you have, into reestablishing and maintaining a relationship with your wife: 100%, no half-assing it, no "walk middle" or "guess so" (points for the reference!), and no giving up until you have a definite answer. Then, and only then, will know the truth. If it works, then congratulations! another fire rekindled, a shaky relationship strengthened, a new "funny story" you maybe tell your kids someday. If not, if after all that you both still feel cold and distant, then I'm afraid it's time to accept that you probably aren't right for each other, and go from there.
I leave you with some of the best fatherly/relationship advice I've ever gotten... ladies and gentlemen, Mr. Billy Joel: