Here are my thoughts on the so-called “prank”
(I am not saying Sirius was not wrong for telling Snape how to get into the Shrieking Shack. He was, it betrayed Lupins’ trust, but this is my view on the whole issue.)
My analysis focussing on these issues
1) Snape already had a theory that Lupin was most definitely a werewolf. He was probably as sure as Hermione was in her 3rd year.
2) Sirius only told Snape how to get past the WW. Not that he should.
““Severus was very interested in where I went every month.” Lupin told Harry, Ron, and Hermione” - Remus Lupin PoA
Implies that Snape already had a suspicion that Lupin was a werewolf, BEFORE Sirius told him how to get past the WW.
This is further backed up by
““They sneak out at night. There’s something wrong with that Lupin. Where does he keep going?”
“He’s ill,”said Lily. “They say he’s ill —”
“Every month at the full moon?” Said Snape.
“I know your theory,” said Lily and she sounded cold.” - Lily and Snape DH.
While this conversation happened AFTER the prank, it is clear that Snape has presented his theory of Lupin being a werewolf countless times, enough that Lily is sick of it, and knows it. Therefore Snape definitely already had a theory based on the Luna cycle that Lupin was a werewolf BEFORE the prank.
“Snape had seen me crossing the grounds with madame Pomfrey one evening as she led me towards the WW to transform.
Sirius thought it would be - er - amusing, to tell Snape all he had to do was prod the knot in the tree trunk and he’d be able to get in after me.” - Remus Lupin PoA
How? Just how did Sirius manage to get to Snape the moment after he saw Lupin crossing the grounds. Because the two events happen on the same night.
My theory (and this is not backed up by facts) is that Snape told Sirius he knew Lupin was a werewolf and that he goes to the WW to transform every full moon and Snape had just seen him. And Sirius just told him how to get into the WW if he was so sure. Because how else would that conversation arrive naturally. But this has nothing to do with explicit canon so it is not part of my analysis.
What is canon is that Sirius only told Snape how to get past the WW and into the SS. He never, at least mentioned in canon, told Snape to go and do it.
This is not a prank, it is merely one student telling another student how to get into a place where they BOTH know a dangerous werewolf is.
Snape knew that Lupin was a werewolf, Snape knew that it was a full moon, and Snape knew that if he entered the SS he would most likely be attacked.
“Sirius Black showed he was capable of murder at the age of sixteen.” - Severus Snape PoA
They learn about werewolves in 3rd year, this is someone who had already passed his OWLs. Snape almost certainly knows how dangerous werewolves are when fully transformed.
Let me ask a question here:
If there is a room that has a password protected lock on it. And inside the room there is a dangerous, aggravated bear that will kill. Person A and B both know that to walk into that room would almost certainly cause death.
Person A has the code, and Person B, keeps badgering them about the bear. Person A gives person B the code. Person B, knowing that there is almost definitely a bear that will try to kill them behind that door attempts to enter anyway, but only gets far enough to put in the code, before they are stopped by Person A’s friend who decided to check and see if Person B was actually stupid enough to try and get through the door.
Would you call this a prank? Malicious? No. It is certainly irresponsible of Person A, but it is ultimately Person B’s choice to put themselves in that position that they know is dangerous. And Person A had no control over the fact Person B tried to enter the room.
Hopefully this makes sense I wrote it in 5 minutes