I might need a cartoon to help me understand the logistics of Hamlet’s justification here.
Here stands Hamlet. Good.
Here stands someone/something that has the power to take him away from himself – Good.
So Hamlet from himself is taken away. The Hamlet part of Hamlet is removed – leaving some non-Hamlet Hamlet.
The no-longer Hamlet Hamlet wrongs Laertes (by killing Polonius and fighting in Ophelia’s grave) and the Hamlet part of Hamlet is like, “it wasn’t me.”
Where, then, was the Hamlet part of Hamlet while the non-Hamlet part of Hamlet was busy wronging Laertes?