Yes, your proof is correct (modulo $P$ is added using a different rule than $Q$).
In natural deduction you have structural rules called contraction, weakening, and exchange.
$$
\frac{S,P,P,T \vdash Q}{S,P,T \vdash Q}\ \text{contraction} \quad
\frac{S,T \vdash Q}{S, P, T \vdash Q}\ \text{weakening} \quad
\frac{S,P,Q,T \vdash R}{S,Q,P,T \vdash R}\ \text{exchange}
$$
Usually, these rules are used silently by saying that the collection of assumptions forms a set. You can imagine not having these as structural rules which leads to substructural logic, the most notable of which is linear logic which drops contraction and weakening.
We can now describe your proof (with the minor correction): $P$ is introduced via $P \vdash P$, then $Q$ is added to the assumptions via weakening ($P,Q \vdash P$), then you use contraction to duplicate $P$ ($P,P,Q \vdash P$) and exchange to bring it to the front of the context($P,Q,P\vdash P$), then two uses of implication introduction.