I would not invite Jamie to the party either. I am horrified by the mother's behavior! I think it would be wise to call CPS for a "consult" about the situation. Tell them what happened and your worries about Jamie. Then, if/when the mother does this again, there is a record. Also, it is plausible that CPS would respond to your initial call by interviewing the mother and explaining to her that her behavior is abandonment. I'm not sure they would but the "consult" could help you determine your best course of action and how to expect the system to respond.
I do think that shielding Jamie as much as possible from the effects of her mother's behavior is kind. You walk a fine line between not rewarding bad behavior and protecting a child from a parent's neglect. I imagine Jamie knows that she wasn't invited and was dumped at your doorstep. What must it have been like for this little 5 year old to know she wasn't wanted at a party and to know that her mother didn't want her at home either, and so dumped her somewhere she wasn't welcome. Even though you included her, she knew going in that she wasn't wanted there. You did your best to make it better for her, but my heart just breaks for her. I can't imagine how heartless the mother must be to do this to a little kid.
For next time, I would first see what CPS advises. I don't know if they would handle it differently if you included Jamie in the party, thus making her a guest instead of an abandoned child. I would plan for her to be dropped off. If possible I would probably take her to her grandmother's house. If there's no one answering the door at Jamie's house or at her grandmother's house, I would have snacks and a movie set up in an alternate room with 1 adult/teenager there to babysit Jamie (if CPS says they can't do anything if she's a 'guest' at your DD's party, otherwise I'd let her be part of the party).
I think there's a difference between including her when she shows up and inviting her. Including her when she shows up means that you put on a show of scrambling a bit to gather a plate, cup, fork, etc for the extra child. It lets Jamie know she wasn't expected without making her feel totally left out. Maybe I'm totally off base on this one though.