I was in what sounds like a similar situation to you Chesire, in that as my marriage failed (although I didn't want to admit it at the time) and I fell out of love with my husband, a male friend of ours, who did his best to help us with our troubles, essentially showed my husband up for what he was, and I very innapropriately fell in love with him and he became so frustrated with my husband, and caring of me, that he felt the same in return.
Our tales do differ though, firstly in that although I realised how I felt about OM, neither of us wanted to have an affair, and I could never have done that to DH (although coming that close was bad enough). Secondly, I was young and had no children or mortgage, thus making my decision much easier (especially as I could only see it getting worse if things were to continue along that vein). I realised (after much crying and un-biased counsell) that I no longer loved my DH (apart from all the other problems) and if I stayed with him, I was still betraying him by having even fallen in love with someone else behind his back.
I had nightmares for months after I told him it was over and the reasons why (including OM). It was the hardest decision I have ever had to make, the guilt was horrific . I still feel flashes of guilt even now for how badly I broke his heart, I think I always will, and although I doubt he'll ever be exactly happy about it, he now agrees that I did the best I could and although it hurt, he's glad I was honest.
I wondered at the time if it would've been different if I had had children and I decided it probably would have been dragged out longer, but DH and I breaking up would have eventually happened anyway. I personally don't agree with staying together for the sake of children, it's usually a much healthier and happy atmosphere once two unhappy parents (or even one unhappy at the other) are no longer living under the same roof.
Whatever your decision, it must be yours and you must take the consequences, whether that be to make a go of your marriage and possibly live in unhappiness; to become a single mother and deal with the hardships that can bring or to leave for OM and the various issues that brings up for the children/your own state of mind etc. (I've only mentioned the bad sides to these few options, but there good sides to each as well.)
Perhaps your decisions so far haven't been the best they could've been, there's nothing you can do about that now, you must move forward. You must be strong and decide, 'I am doing //insert course of action here\ because of these reasons and it's what I believe is right. If it comes back to bite me, I only have myself to account for it.'
Good luck with whatever decision you make. I'm afraid it's going to be difficult whatever you do.