I don't want to spend too much time deciphering this book's idiosyncratic and obscure system of abbreviations. But I gather that the idea is:
- We have already shown $Q$ in step 3.
- We can hypothesize $P$ in step 5 and then claim that $P\to Q$ because $Q$ has already been shown.
This is sometimes called the rule of reiteration. (I suppose this is why the author chose the notation r.) Symbolically, we can write it as $$A \to (B \to A)$$ If we already know $A$, we can conclude that $B$ implies $A$, for any $B$. In your derivation, because we already know $Q$, we can conclude $P\to Q$.
This is indeed counterintuitive. It's one of the notorious paradoxes of material implication. The confusion arises because the formal logical meaning of $A\to B$ is so different from the conventional notion of "if… then…”.
In formal logic, $A\to B$ is a very weak claim. It does not say that $A$ causes $B$, or that $A$ and $B$ are related in any way. All it says is that whenever $A$ is true, $B$ is also true.
But if we interpret $\to$ in this way, $A\to (B\to A)$ is always true. It says is that whenever $A$ is true, $B\to A$ is also true. And this is correct! Because if $A$ is true then, whenever $B$ is true, $A$ is also true.
Perhaps a more straightforward way to prove the theorem would be: Assume $\sim T$. From premise 2 conclude $\sim S$ by modus tollens. From $\sim S$ and premise 1, conclude $\sim(P \to Q)$ by modus tollens. $\sim (P\to Q)$ means $P\land \sim Q$ by definition, so extract $\sim Q$. From premise 3, conclude $Q$ by modus ponens, a contradiction, and the original assumption $\sim T$ is false.
But I make no guarantees that all these steps are valid in this author's unpleasant logical system. My advice would be to pick up a secondary text that explains how to do proofs via analytic tableaux, and learn logic from that. Once you understand it, writing the proofs in a more natural way, and then translating them into your book's weird formalism, will probably be easier than trying to construct the proofs directly in the weird formalism.