IANAL, but a couple of thoughts about the legal angle:
- The settlement agreement is not yet approved by the judge, it's not yet entered as final judgement, so Elon is probably not bound by its terms yet - mocking the SEC is not against the law.
- The SEC is a federal agency, if they retaliate in any fashion against Elon for voicing his opinion then that looks like a clear-cut violation of Elon's First Amendment rights.
- The SEC cannot simply rescind the agreement, nor can Elon. To rescind the SEC would have to prove to the judge that Elon does not intend to honor the agreement. Making lawful statements of opinion about a federal agency, before the agreement is entered as final judgement, do not appear to be valid grounds to rescind.
But keep in mind that IANAL.
Nevertheless doing this probably wasn't wise: Elon is (again) lashing out from a position of apparent weakness.
Instead he should start bribing the political process like absolutely every other billionaire does, and once Tesla is strong and has a moat of politicians protecting it, he should communicate from a position of strength.