What will happen to a creature turned into gaseous form, then skewered or partly locked in small space right before cancelling the spell?
Assuming gaseous form doesn't make body parts easier to remove
The 3rd-level Sor/Wiz spell gaseous form [trans] (Player's Handbook 234) mentions nothing about a creature losing cohesion: all of the creature's parts remain just as firmly attached to the creature as when the creature was in its normal form, despite the creature's gaseous form now being "insubstantial, misty, and translucent," and, obviously, much more flexible. A creature that's assumed gaseous form, for example, won't be sucked up, dispersed, and slain by a ceiling fan nor will the creature be able to ignore a mighty barbarian's sword violently entering its gut.
That is, a creature that's assumed gaseous form isn't immune to damage. On the contrary, the creature gains only DR 10/magic from having assumed gaseous form. So, unless the DM rules that, for example, a 3-ft.-diameter spike through a creature's space would also automatically doom a creature not in gaseous form, a creature—whether it's in gaseous form or not—makes any appropriate saving throws against the effect, is dealt the appropriate damage, or both. A creature shouldn't suffer a greater effect (like instant death) because the creature was in gaseous form then resumed normal form: the effect should've already been resolved, and the game should've moved on.
Also, keep in mind that 3.5 largely omits rules for removing body parts, leaving it to the DM to adjudicate such effects if they occur. However, while the spell gaseous form is not part of the polymorph subschool, the 9th-level Sor/Wiz spell shapechange [trans] (PH 277–8) is, and that spell likewise allows the assumption of gaseous form. The subschool's description includes this line: "Any part of the body that is separated from the whole remains polymorphed until the effect ends" (Rules Compendium 122 or Player's Handbook (2012) 320, this latter likely the last word on the matter). Thus if ersatz rules are absolutely necessary—for example, the 3.5 DM has introduced into his campaign an old school adnd-style sword of sharpness then saw the weapon used successfully against a creature that's assumed gaseous form—these rules are as good as any.