Unfortunately it does seem you are using $\mathsf{LEM}$ in step $2.$ As you mention yourself:
Otherwise if $m \neq n$, either $m = n+1$ or $m \neq n+1$ [...]
is not justified by anything. (It would of course hold if we had $\mathsf{LEM}$, but we don't have it at our disposal)
There is indeed something critical happening at step $2$ and it's worth pointing out. Let's illustrate this by carefully giving this proof a failed attempt.
(I will be using the notation using the successor function $Sn = n +1$)
Proof Attempt
Let $m$ be given. We will try to show $m = n ~\lor~ m \neq n$ by induction on $x$.
Base Case: Show $m = 0 ~\lor~ m \neq 0$. Just as you did, one can do the case distinction $m = 0 ~\lor \exists x : m = S x~$. In the first case obviously $m = 0$ and in the second case we indeed have $m = S x \neq 0$ by an axiom of $\mathsf{PA}$.
Induction Step: The induction hypothesis is
$$m = n ~\lor m \neq n~ \text{ and we need to show } m = S n ~\lor m \neq S n.$$
Again we do the case distinction $m = 0 ~\lor \exists x : m = S x~$ and in the case $m = 0$ we have $m = 0 \neq S n$.
Now in the second case we have $m = S x$ and what remains to show is $S x = S n ~\lor S x \neq S n~$. Now it's time to remember that the induction hypothesis is $S x = n ~\lor S x \neq n~$ and with this, we are stuck. The induction hypothesis is not strong enough to finish the proof. And this hopefully becomes clearer as we try to fix it:
Fixed Proof
This time we try to show the statement $\forall m: m = n ~\lor~ m \neq n$ by induction on $n$.
Base Case: Show $\forall m : ~m = 0 ~\lor~ m \neq 0$. This works the same way as before.
Induction Step: This time the induction hypothesis is stronger! It is
$$\forall m : m = n ~\lor m \neq n~ \text{ and we need to show } \forall m : ~m = S n ~\lor m \neq S n.$$
So for given $m$ we need to show $m = S n ~\lor m \neq S n~$.
As previously we do the case distinction $m = 0 ~\lor \exists x : m = S x~$ and in the case $m = 0$ we have $m = 0 \neq S n$.
But unlike previously, we now have $m = S x$ with induction hypothesis $\forall m : m = n ~\lor m \neq n$, which allows us to conclude $x = n ~\lor x \neq n$. Then we are left with two cases:
- If $x = n$ we have $S n = S x = m$.
- Now for $x \neq n$. Assume we had $S n = m = S x$. Then by the injectivity of $S$ (an axiom of $\mathsf{PA}$) we get $n = x$, a contradiction! Therefore $m \neq S n$.
So indeed we were able to show $m = S n ~\lor m \neq S n~$. $~~\Box$
The above proof is constructively valid and hopefully showcased that the crucial part is that we do the induction on the statement which still has $y$ quantified.