Here's the thing: I'm more of a "panster" than a "plotter." I know there are people (you may be one of them) who can plot out your WHOLE story and you'll know how each and every scene will go. I can't do that. It makes me feel like I already wrote the whole story, and then I don't want to actually write it. I have some plots points--I have major events that I know I'll need to hit, and I typically know how the story will end, but how I get from one point to another is usually up in the air. I discover it as I write it.
This does mean that from time to time, I write myself into a box.

In some cases, this means backtracking and writing something different, but I never consider it a waste of time or effort. Sometimes, writing something one way shows me how things won't work and I need that to find what will work.
Other times, I don't backtrack. I examine this box I wrote myself into and I try to figure out how in the name of Santa Claus's monkey I'm going to write myself out of it again. This can be frustrating at times, but I find it kind of exciting. There's a solution somewhere in there, and who knows what might happen once I find it?

And then after examining the box from all angles and maybe doing some scribbling on the insides of it, a solution is found.

Writing myself into a box can force me to think of things I might not have otherwise thought of and shapes the story in previously unseen ways. It's given me important storylines and even more important characters that I wouldn't have had otherwise.

Do you write yourself into boxes from time to time? Or do you have everything planned out so you don't get stuck that way? If you do write yourself into a box, how do you handle it?