Usually I have some sorta plan when I write. I've thought the most important parts of the dialogue, the locale, the characters, the general feeling. It's like I've watched a movie and all I have to do is describe it. At points, I wish I had the budget to shoot movies, because I could play with camera angles, something that's incredibly hard to write.
There are things I don't intend to happen, it happens, and I work it out. I refine dialogue. I think of better things, of extra scenes, and I just write the crap out of it. Sometimes it's totally out of the blue... and at times, I honestly don't like it. It messes with the images that I already have in my head and it may totally fuck my own ideas up - that kills it for me. So I end up rethinking everything, reimagining scenes, actions and so on. At other times, it flows perfectly, and I'm proud of how things turn out.
So even if I do think when I write... I reach automatic mode eventually. It works. Lately, however, I've been overthinking things and as a result, I can't seem to write anything. I'm trying to fix that though... once again *sigh*.