Hopeless, I am so sorry.
Please do not blame yourself for the affair your husband is having.
Two wrongs don't make a right, and it sounds like you both worked on making everything ok.
You said you thought the affair was just about sex, well, I think most of the time they are, but I think it is really sad that both the other woman and your husband are throwing away their marriage for sex.
I do not know what you are going to say to him, but this is going to be a very painful situation, especially since it involves his best friend too!
Good luck to you