I think that norms are what are keep them most things in check and to preserve legitimacy they rule mostly on constitutional issues but I'm sure they can review any ruling in lower courts that they like or even overturn old rulings as they see fit. They cannot write new law as that is explicitly congress but they could take cases and interpret them broadly or narrowly to skew the desired result. If they tried to write laws themselves presumably they would be ignored or removed either via impeachment or by physical force. In a situation where parties are adhering to the rules then either congress can pass new law to clarify intent (and probably fight again) or pass an amendment to constitution or states could call constitutional convention to overrule an undesired court ruling.