These types of ideas definitely fall under the Rule of Cool. I wouldn't worry about all the issues regarding the worm's other stomach contents, or whether the power is being abused. Unless you're facing a megadungeon full of purple worms and other swallowing creatures, doing something like this won't break your game.
You don't want to trivialize the encounter, so I'd strongly recommend leaning away from the insta-kill. Nobody wants a level 1 wizard to one-shot a level 16 solo on a miss.
Encourage the player's awesome idea by giving them an awesome reward (a ton of damage) with a minor drawback (the fighter takes damage too). Here's my suggestion:
- The worm is forced to vomit the fighter out into a random adjacent square.
- The worm takes damage equal to half it's bloodied value (1/4 max hp) due to the violent transformation.
- The fighter takes damage equal to half her bloodied value (1/4 max hp) due to the crushing force of a purple worm shrinking around her.
- The worm is instantly restored to it's normal shape due to taking damage.