D.B.
I am so glad that you have found a place to move to where you and your children will feel safe and stable. If you can make it another 3 weeks in an environment you dislike but don't think is unsafe, great. It's one less adjustment for the kids.
I think there are friendships that last forever, and some that last for a while and run their course. There are books we read that will treasure and will re-read, and others we're done with. There are jobs we work at that we love and stay with, and others that no longer apply.
I think you do need to be very grateful for this woman taking you in when you were at a low point, and who, despite her many flaws, gave you a chance to get on your feet. I hope that you thank her profusely and, as you continue to get on your feet financially, you send her a check for some additional payback of what she did for you for heat, electricity, groceries, whatever. I really think that writing a letter is a bad idea. You are not breaking up with a husband or a life partner, first of all. Secondly, if she thrives on drama as you suspect, why fuel it with more drama? It would be a slap in the face for all she has done for you, and there's no way for her to take it as anything but "I used you, I'm done with you, I'm casting you aside." I know that's not what you mean, but it's how it will come across.
What you do is the following:
1) pay it forward. You make your home or your efforts or whatever available to someone who needs you. And you let her know that you are there for her if she's ever in desperate straits like you were. If she's in a bad relationship, the time may come when she will need support to get out of it, whether she stays in her house or not. Maybe one of her kids will need a quiet and drama-free place to stay if things turn ugly at her house. So you stay open to those possibilities. If you can't help her in person, you can help her get to services that can help her, but I think closing the door and saying "You're on your own with your crazy life, dearie" is just too cruel after what she has done for you. She doesn't know she's a negative influence on you, and it's possible that she disagrees just as much with your parenting style as you do with hers. Maybe it hasn't been so wonderful for her to have you all under her roof either - so while you don't have to hash it out with her, you would probably benefit from being open to that possibility too. I'm sure I'm irritating as hell to some people but they just haven't told me about it.
2) Let the friendship drift away without launching a torpedo at it. She'll move on with her life, and you'll move on with yours. You'll see each other less frequently. Maybe you can all go to a part or the movies or for dinner now and then. Maybe you treat her once of twice to thank her for what she has spent on you when you couldn't pay your own way. You spend a few hours together in an activity, without being under her roof or where she's having sex with her boyfriend. Whether she hugs her kids is not your concern. If she's beating them or doing something else abusive, then you report it to CPS. Otherwise, you let your get-togethers become less frequent.
Good luck in your new place and I wish you all good things!