Hm, well taking into account the other points of view here and rereading the original post, I am swaying far from my first opinion.
The MIL obviously cared enough about the stepdaughter to assume custody and raise her when the family broke down. At first I suspected that possibly the MIL was "buying affection" by perhaps giving a car, lenient rules, or such so that the stepdaughter would prefer to live with grandma, and the OP does say that the MIL has tried to minimize the husband's relationship with his child. But perhaps that is for the child's best interest. After all, this is her own son whom the grandmother is wary of and he was, after all, in prison at the time. It would seem most reasonable for the son (the husband) to be attempting to heal the relationships with his mother and daughter - is he doing this? If so, he will need your support. Maybe the MIL is bitter and angry (and possibly not a very nice person, either). She may be quite upset that her son is starting another family while leaving her and her granddaughter with the wreckage of the first.
In rereading the original post, the only situation that I can see that the MIL "caused for herself" by the decisions that she made is to raise another child late in life - which is hardly something to blame her for.
I guess I would ask the OP to ask herself: what are you afraid the MIL will do that you need to protect your baby? Can you be open-minded enough to assess whatever truths that uncovers and work on correcting perceptions, behaviors, & healing your relationships? Maybe a better position than withholding your child from the grandmother is to use the opportunity of your child's birth to learn and demonstrate to others what love and compassion are. If the MIL is abusive then you should protect yourself and your baby. But if she is just angry then can you be a bigger person than she? As an adult and a mother, I think it's imperative that we learn to take the highest road possible; since you don't need her approval, being an adult and a mother, you can be gentle & let her anger roll off your back. There will be ten tons of challenges coming your way as a mother, you could use this situation to start practicing
I hope that things work out well for you and your family and extended family too. Feel free to post here for advice and support.