One thing DnD gave me through all these years of playing and thinking about it is it developed that part of my mind that asks "And that what would happen, based on all the variables in the equation, to the best of your ability to predict based on all you know of the world about you and human nature, etc." I am weird in that I can lay in bed for like half a day at a time, not moving, looking at the ceiling, playing my equivalent of DnD chess, figuring out all outcomes and responses. Its like playing Chess against myself in my head. Worked hard at that training ability during a period of depression in college. Weirdly, its helped me as a lawyer, though I hated the practice of law with a white hot passion.
As far as DnD goes, no surer way to a railroad can possibly exist. I've taken that road in the past with players, they hated me for it, and I don't want to go there again.
What I do now instead, in order to keep the both the players and me on our toes, is keep throwing shit into the equation, so that I can't predict the outcome right away. I just threw a war on so many fronts with so many players and variables at my players, that I have no idea how it will turn out. And that's a good thing I think. No risk of railroading them, their input matters as to the outcome, and lots of spontaneity in the game session as I have to figure shit out on the spot.
I kinda like it that way. I think its essential for a Sandbox campaign. The one I am running basically is harsh and gritty, using LOTFP Grindhouse as a ruleset, where all the people in power operate essentially as clever sociopaths. I guess I'm succeeding in the goal, because last week one player said I'm like Tony Soprano as DM.
Now I just have to try not to think about it at night as I try to fall asleep. No surer way to sleepless nights can possibly exist.