part of what goes into "planning" comes from acquiring the craft of a composer: counterpoint, harmony, voice-leading, various compositional techniques, etc...
Examine a simple classical sonata-allegro movement, one with two themes, a development section, and a recapitulation.
You will see that for 4-5 minutes of music, the actual basic material is often NOT terribly varied. it is, in fact, "development" of the material stated within the first measures of the work.
Meaning, there is no "new" material added as the work advances. Everything should grow out of the initial material stated in the exposition.
This is a simple for of development, and is a large part of the "planning" process.
When starting, it is always good to start with pre-established forms that give you a solid outline to follow.
Most pieces of classical music - even some very modern stuff - tend to be in one of a handful of straight-forward classical forms: rondo, sonata-allegro, ternary, binary, scherzo, etc...
The problem with "one musical thought seems to follow from the next" is that it creates a sense of patchwork, that the entire work does not have cohesion.
"Through-composing" (that is, "writing as it comes") works when one has a good solid background and understand the craft of musical composition. Otherwise, it is a minefield of traps and dead-ends.
planning can be as simple as saying:
30 seconds - main theme
45 seconds - 2nd theme
1.5 minutes - development
2 minutes - recapitulation
30 seconds -coda
You can start with something that simple, then build from that. As your material comes into being, you will know more of what can be done with it. Then you can alter things, like the "development"... for example
1 minute - develop main theme
1 minute - develop 2nd theme
2 minutes - reverse character of main and 2nd themes
30 seconds - build up to recapitulation using fragment of 2nd theme
etc...
Those are just ideas on how you could plot a course for a composition.
I still do this, in a slightly more detailed manner mind you, but still do it.
And the point is to actually STICK to your plan as much as possible.
When you hit on little things that deviate from the plan, set them aside. write them down, but set them aside. Later, you can see if there is a way to incorporate those happy little accidents into your composition.
When composing, a lot more music will end up on the cutting room floor than on the actual page of music. And this is normal.