The administration has been preparing for months for the possibility that the Supreme Court would rule against the president and developed contingency plans.