In the sentence, "Close your eyes, for just a moment..." which is more correct:
"For just a moment;"
"Just for a moment?"
"Correctness" (whatever that means) is not at issue here. At issue is which part of the sentence you as the writer want the reader to focus on. It’s your choice, and it means something slightly different each time.
Just is a kind of word that we call a focusing adverb, much like only, merely, or simply. Its position tells the reader or listener what they should be paying more attention to. As such, the position of a focusing adverb is free to float to almost any position in the sentence.
Wiktionary has an entire category for these.
You are interested in the following sentence fragment:
Without the comma, both are 'correct' and mean pretty much the same thing. If pressed, one might quibble about "for just a moment" focusing on the shortness of the duration and "just for a moment" focusing on the existence of the short duration.
With the comma (as written), I think the sentence completes more easily with "for just ...", with "for" meaning "because":
The comma looks out of place with the "just for" variant. It disconnects the eye-closing and the duration, but it doesn't look like it disconnects them sufficiently. Starting the next clause with "just for" suggests that it would be an independent clause, e.g. "Just for a moment there, I thought the laser would turn on." In that case, the comma should really be something stronger, a full stop or semicolon, perhaps: