First of all, breathe. In the heat of the moment it can be difficult to know you are doing the right thing, but you know you are. The consistency is working in that she knows you will be there. That is no small feat.
Second, you need a break. It is exhausting to constantly feel like your whole world revolves around someone else’s needs with no end in sight. Yes, your husband and his ex-wife need to get over it and move past it. Yes, it is trying when someone (especially a child!) constantly pushes your buttons and tests your patience. You have to take care of yourself. Join a support group, get into therapy, learn how to make your own bath bombs and take baths, drink a cup of tea, whatever works. Find something that helps take the edge off and then do it.
The next steps are really up to your husband and his ex-wife. Your step-daughter sounds like she is hurting, deeply, and lacks the skills to express those emotions. Every kid is different, so until she learns how to express her hurts, hopes, and needs, this is going to suck but she will get through it. You ARE doing the right thing. She may feel her behavior caused the divorce, or pushed her own mother away, or even that your children are going to replace her because she is “bad”.
If no one else is willing to change right now, you change. If she smears poop on the wall? Close the door, dad cleans it when he gets home with her help. You can take a bath while they do that. Tell her you love her, but that is not okay. Tell her that is not princess-like behavior, and talk to her about how princesses do behave (there are many positive examples). The social issues are likely a complete and total lack of confidence, so empathize with her. Did you ever have problems with friends? Invite her to have a slumber party with you and watch Lilo & Stitch, ask her how she would help Lilo make friends. Don’t react if she says something awful, just ask calmly how she thinks that would help. Watch movies with unconventional heros (think Mighty Ducks, Cool Runnings, etc.) that teach how hard work can pay off, take breaks to make popcorn or milkshakes and ask her about the problems the kids are facing in them. My guess is that she spends a lot of time with people talking to her but not listening to her.
Can you befriend her mom? Have her over for a lunch you and your step-daughter prepare for her? I know that all of this sounds like crazy rewards for a defiant child, but at this point she needs to know that you won’t give her negative attention. Can you imagine being 9 and not knowing how to make friends, or whether or not your mom or dad would stick around? All of the adults tell you to take this pill and things will get better, but they just don’t? All of the things in her life right now reinforce the idea that she is bad. Don’t feed into that.
You can do this. Yes, it sucks to be the bad guy all the time, to do the heavy lifting, to feel like a virtual single-parent, but that doesn’t mean you have to continue things the way they are because everyone else involved expects you to.
Good luck!! You are in the right place, you are doing the right thing, don’t give up, just do differently. Never forget to take care of yourself!