Hi, A.. Yes, it sounds like you handled the situation very well. I think the best discipline for this problem is to make the child go back into the store, give back the stolen item, admit to doing it, and apologize for it. Absolutely, 100% good idea.
And yes, this does create a very uncomfortable situation for the child, but if it weren't painful and embarassing for the child, she would keep on stealing from the store. You WANT the consequences to mean something so that she will realize that the pleasure of doing the bad thing is outweighed by the consequences she gets from doing it. Absolutely, you want to give her consequences that mean something!
Yes, she SHOULD feel embarassed and angry with herself. But you also need to forgive her and let her know she can do better, and that you expect her to do better next time.
Now, if this is the first time she's done it, then I think this is where it should end. If she does it again, the consequences have to be a little more demanding. She would have to do the same thing -- go back, admit it, apologize, hand back the item, etc., but you will want her to do something else, too. If she is already reading and writing, you can have her write sentences such as "I will always respect other people's things and never take what doesn't belong to me." 10 times or 20 times should do it. If you are spiritual people, you can remind her that the 10 commandments states, "Thou shalt not steal," and that God expects everyone to respect everyone else's property.
Kids her age are still learning impulse control. This is a part of that process. Don't be too alarmed that this is happenning right now. Probably all the kids at school have an issue with keeping their hands to themselves in one way or another, and they all are having to learn impulse control in different ways.
Don't panic, and don't put too much attention on this issue. Give her positive attention for all the good things she does, and don't give her negative attention because you're afraid of what she might do next. The positive attention reinforces the good behaviors you want to promote. Make sure she gets rewarded for good things WAY more than she gets punished for bad things. Otherwise, she will seek out negative attention because it's easier to get. All kids can fall into that trap.
Peace,
Syl