Best way is to force them to deal with the logical consequences of their action. It's even better if it's a consequence they hadn't thought of or planned for.
If the logical consequence is a TPK, you can go with that, or throw in some Deus ex Machina to save the PCs and keep the game going (but penalize the players in crafty ways).
(edit) Didn't read the question correctly. If you want to throw spontaneity at them, I have a few ideas:
- An NPC, or group of NPCs, that is also engaging in spontaneous action, that somehow always manages to inconvenience the PCs. A cult? Pirates? Anarchists?
- environmental effects. (ion storm? meteor shower? solar flare?)
- Systems malfunctions, either in their own ships or in the ship they're sneaking around -- some of these will help, some will hurt, some could be either (artificial gravity malfunction)
Make a chart ahead of time and then roll for what happens -- if it's something that would TPK or make mission completion impossible or a cinch, you might want to re-roll.