It actually has to happen before a judge can issue an injunction. It’s born moot.
If he does close the borders surely some judge will issue an injunction. Then the President merely declares a clear and present danger, ignore the injunction by declaring a hostile emergency and remove it from the reach of the judiciary.
That would be nice. Odds of him doing that?
(Rhetorical, don't bother)