Sorry you find yourself here. Early 40's seem to be a trigger for many folks, so your story is unfortunately repeated day after day all over the world.
Obviously you've figured out that pursuing/begging/pleading/shaming do NOT work. The best advice I can give you immediately is to engage a DB coach on this site to help you navigate your path forward. The *great* news is that your W is saying she wants to work things out, but it seems she's not fully committed, which is pretty normal.
Buy and read "The Divorce Remedy" and review Sandy's 37 rules.
A few points for you:
1) You are not in competition with OM: That relationship is based in fantasy and yours is a reality. You *cannot* compete with an affair partner because people in an affair view even the OM's problems as benefits, and will view all your benefits as problems. There is no level playing field or rational decision making going on at all, so just give up worrying about it, there is nothing you can do. All this will do is pummel your self-esteem.
2) If you are going to be successful, your W needs to agree to go "no contact" with OM now and forever, including changing jobs if necessary. That MUST be a condition you impose that you do NOT negotiate. That is a walk-away factor. Your W has become addicted to her feelings with OM and people who are addicted cannot continue to dabble and at the same time heal. It just doesn't work. Plus, your self-esteem will not recover as long as the two of them are in contact. You cannot make this demand now as she'll just ignore it. You need to make it at the point that she says she wants to get back into a marital relationship with you.
3) Be careful with what you overhear in your snooping. People say all kinds of things all the time when they think they are in a private setting. A lot of that can be false bravado, a whim, etc. When you're not listening, the consequences are minimal so they will spout off with things they don't mean. Hearing them can create more of a problem because you will interpret them as real and permanent when they may not be.
4) Your W's comment that she feels unloveable is interesting, but this is a common way for people to feel after they've had an affair and feel remorse. Although they won't admit it to you, they feel badly about themselves and this is one of the ways they express it. I would not dwell on this unless it gets repeated for several months. It's more like a stage of grief.
5) Marriages need balance to survive, and with your begging, pleading and spying you have put yourself in a "one down" position. That needs to stop. She needs to see you as confident, capable and self-assured. Marriage counseling can be your enemy in this regard, because the counselor can prompt you to be vulnerable and say things in front of W that are best kept to yourself at this point. Evaluate very carefully what you say in MC such that you are not deepening your one-down position. The other things that will help with your self confidence include GAL (described in the book), act-as-if (described in the book, like "fake it till you make it"), and goal setting and achievement for things outside your relationship.
Let us know if you have specific questions or want specific guidance. No matter what happens, you will feel better and you will find happiness again, with your W or without her, but it will take much longer than you are expecting -- months, not weeks.
Acc
Married 18, Together 20, Now Divorced M: 48, W: 50, D: 18, S: 16, D: 12 Bomb Dropped (EA, D): 7/13/11 Start Reconcile: 8/15/11 Bomb Dropped (EA, D): 5/1/2014 (Divorced) In a New Relationship: 3/2015