What happens if it makes it all the way to the Supreme Court (which it will) and they rule that the FISA court is not a court and their actions are not lawful?
That seems vanishingly unlikely, even if the makeup of SCOTUS were to change dramatically.
All existing gag orders are null and void and the NSA has no power to do anything.
The NSA's authority does not derive from FISA. For one thing, the NSA was authorized in 1952, and FISA was passed in '78.
The magical Supreme Court unicorn cavalry is not going to save us from an overreaching Federal police state. SCOTUS sometimes reins in the other branches, but it's hardly consistent in that regard, and the Executive branch has not always conformed to the Court's decisions. The Court has no enforcement powers; the government obeys its dictates because playing by its own rules (sometimes, in public) lends it legitimacy. But the government retains its monopoly on authorized violence and has never been reluctant to violate its own laws if it can do so in secret. (This is, of course, true of pretty much all governments.)