Here are the things I consider.
Moving a phrase can make the sentence more clear or less clear.
moving a modifier further away from the thing it modifies
sometimes makes makes the relationship
harder to see.
But not always.
I'm not sure how to give rules about that,
but if you consciously check
how the ordering affects the clarity of the sentence,
you'll do okay.
For me, clarity trumps all of the following considerations.
The order of phrases
can can affect
how much information readers have to hold in their heads
as they read.
I want to make it easier to read my sentences.
In his brilliant book Style,
Joseph M. Williams says that the end of a sentence
is the stress position.
Readers tend to give more emphasis
to the information they find
at the ends of sentences.
So I try to arrange phrases
so to take advantage of that.
Move the most important information,
or the most interesting information,
or the most surprising information
to the end of the sentence.
(That previous sentence
is a counter-example.
Moving the interesting stuff to the end
made the sentence less clear.)
I think about emphasis a lot when I write non-fiction,
and sometimes when I write fiction.
Changing the order of phases
can enhance or hinder
how well this sentence follows from the one before it,
or leads the reader into the one that comes after.
In fiction especially,
I want to hold the reader deeply in the story.
So I work hard to make sure that
when the reader ends one sentence,
they are perfectly primed
for the beginning of the next.
I apologize for not providing examples of these things.
I am pressed for time at the moment.
I will add examples as I think of them.