The rules decided it. I did a few other things, using spells that weren't attacks. But once I was out of those, the only attacks I could make were melee basic attacks, and escape happens when the monster is dead. That's what the (unerrattaed) MM says. The errattaed version is slightly better, in that it throws the wizard and warlock a bone.
I don't want to say you were "playing wrong" or not using the RAW, so let me get that out of the way to start off with!
Let's see what the text says:
MM pg 214 said:
The swallowed creature can make melee basic attacks only, and only with one-handed or natural weapons. If the purple worm dies, any creature trapepd in its gullet can escape as a move action, ending that action in a square formerly occupied by the purple worm.
When I read "can make melee basic attacks only", I see that as a restriction against using powers, not that the only actions you can take are melee basic attacks!
So I could see you, I don't know, trying to trigger some sort of gag / vomit reflex so that it would expel its tasty meal. (I think this is exactly the sort of thing the DM would want to say Yes to, not just because I think it's neat, but because you're having a crappy time in this encounter.)
The stuff about the purple worm dying and how you escape - I don't read that as the
only way to escape; it's just the way you do escape once it dies.
I guess your group read the entry differently that I would.
My point is that this is what Page 42 and the advice to Say Yes are for. These kinds of situation where the rules are making an encounter not enjoyable for someone, so you use the rules there to adjudicate it so that you have more fun.
If my DM was saying to me, "No, you can't cut him out", "No, you can't use a rope to pull him out", "No, you can't trigger a gag reflex", "No, you can't use an Acrobatic stunt to get out," I'd have to talk with him about expectations about the game, how the encounter was not fun because of his rulings, and what we could do in the future to avoid things like this.