What if Gandalf had no idea what he was about to do about the balrog... he's just so attuned to his intuition that he knew the universe was fixing to use his staff as an instrument to prevent it from passing.
Maybe being a wizard means knowing what you have to offer the world and keeping it with you at all times;
Practiced. Mastered.
Ready at a moments notice should it ever be called upon.