My frog regurged her stomach once when she was very little shortly after I got her home from the pet store. When she did, she actually used her feet to swipe off what appeared to be a cricket head, and I used the tip of some tongs to keep her mouth from clamping down on it until we could get it worked back in (didn't know what else to do, and kind of panicked). But when it happened it was very obviously her stomach; her entire side looked hollowed out while it was happening.
Other than not feeding for awhile and leaving her alone I didn't do anything, and she's fine now (close to 4 years later). I'd imagine whether or not they recover has to do with whether or not any damage is done to the stomach and surrounding muscles...
If you can get a picture of the frog it would be helpful. Like has been said, never pull food out of your frog's mouth. The behavior you're describing before you pulled the worm out sounds kind of normal to me; pawing at a prey item is normal. Mine will often pin worms down with her front feet while she eats.