During the eventful night at the end of the Prisoner of Azkaban, Harry, Ron and Hermione simultaneously cast the Disarming spell at Snape from the Shrieking Shack, sending him flying back and knocking him out.
Hermione rightly observes: “We attacked a teacher. . . . We attacked a teacher . . . ,” and that “Oh, we’re going to be in so much trouble —”
However, events so transpire that Snape was to arrive the triumphant at the school holding the others (except Lupin) bound. But he then tells the Minister who arrives for Sirius that the trio had been Confunded by Sirius, effectively saving them of the charge. This could be seen as a concession in the light of his sense of double triumph, of having done a good job of cornering a most wanted criminal, meriting the Order of Merlin, and of having his 'sweet vengeance' on his arch-nemesis Sirius by showing him his way to peril
But hereafter events transpire in even more unexpected and strange ways that Harry and Hermione manage to let Sirius escape (almost about the same time) leaving no clue as to anything. We know that this caused a severe disappointment for Snape. When Dumbledore also managed to acquit Lupin, he must have been beside himself, for as Lupin said,
"That was the final straw for Severus. I think the loss of the Order of Merlin hit him hard. So he — er — accidentally let slip that I am a werewolf this morning at breakfast."
Now the question is why didn't he implicate the trio now on the charge of attacking him at the Shrieking Shack? That was all he could do now, and Dumbledore could not have easily interfered here, as their wands would have told the truth, via Priori Incantatem. And the Confundment theory was propounded by himself, and could as easily be withdrawn at will.
That Snape recognises all possibilities is beyond doubt as he had said as early as from the Shrieking Shack, “Miss Granger, you are already facing suspension from this school."
So, why did Snape not go on to get them punished, even expelled?
He tells Bellatrix in Half Blood Prince (at Spinner's End) that "I have done my utmost to have him thrown out of Hogwarts, where I believe he scarcely belongs", but the question is, was he telling Bellatrix the truth, or did he really want Harry to be protected inside Hogwarts, besides sincerely wanting him alive?