First, you seem to understand this very well, but you are NOT being too honest with them. The ONLY thing she's apparently comfortable sticking to you is the accusation that you lied--and the fact that you lied to protect your children from her shameful actions with your husband doesn't buy you any slack from her, because you don't matter to her and neither do they.
Second, this means that you should go on telling your sons the truth if you can. The hard part about this, I would imagine, will be telling the truth without actually being mean and spiteful. You should probably *feel* mean and spiteful, and you will have ample opportunity to play the vengeful game of back-biting while you are telling the truth. It will be hard to tell the difference sometimes because, frankly, an honest accounting of what he and she have done to your family will sound mean to them. That's because they've behaved shamefully, not because you're mean.
I've never had to deal with an affair, but I do teach middle-school students with behavior problems, and I see many similarities.
You are doing well, but the sad fact is that she may often react to any honesty or display of resolve from you with these kinds of attacks. There is an old saying that taking flak means you're over the target, and it's often true. She's trying to shoot you down because you're doing well, not because you're not.
You've done the right thing so far. You told your children that you haven't lied to them recently, and you told them the truth about the lie you did tell. Your 7-year-old will be confused, but your 10-year-old will probably see--eventually--that your "lie" was told in an attempt to spare him, when the ugly truth would have served your anger better. You will eventually get the credit for this, but it may take time. The problem is that you can't really shield them from the big stuff. You don't have to tell them details, but the big things, like their dad moving out . . . . I know why you want to protect them, but you probably can't. They'll see these things happening whether you answer their questions or not.
Your son only told you about what she did because had some idea that it wasn't right, even if he couldn't figure out how to say that at 7 years old. Take heart. He knows she shouldn't be doing that. It's not going to work. She can hurt him, and she can make your lives harder, but you aren't going to lose him to someone who talks to him that way about his mother.