I dont think it makes it immune, but it shifts the balance of action.
If you're rich being "Immune from the law" is not a binary thing (and we've already seen Elon treat the law in this way), and owning Twitter could make Elon immune from the law for longer.
If the SEC got an injuction against Elon tweeting, how it would manifest and play out would be very different depending on whether Elon owns twitter or not.
Currently, twitter have no interest in defending Elon and would fully comply with any injuction, ban Elon, and let him fight it out with the SEC and jsut go along with it. Whether Elon wins or not, he'd be banned from twitter for weeks/months until it was settled.
If Elon owns Twitter then they are not going to remove him until every legal avenue has been exhausted. Both Twitter and Elon personally would be fighting the injunction. They would fight every point and, even if they knew they'd lose, throw up any delaying action they could just to keep Elon on Twitter for longer.
Basically:
Independant Twitter: Elon is silenced for months while the courts thrash it out
Elon Twitter: Elon is very vocal for months while the courts thrash it out
And that is ignoring the possibilty of Elon manipulating the world and using twitter to manipulate the court case (which we've already seen him try to do). Imagine if he threatened to let Trump back on twitter and whip up anti-biden sentiment in the run up to an election? The SEC/Courts are meant to be politically independant, but in reality he might even get the SEC to back down completely. Something that would never be possible if he didn't own twitter and wasn't allowed to tweet.