(CW: Discussion of self harm and the description of the execution)
Something seems wrong here. What nitrogen does is replace the oxygen and CO2 in your lungs. Our self preservation instinct doesn't actually respond to a lack of oxygen, but a build-up of CO2. Because of that, nothing is felt when it's all replaced by an inert gas (which, being inert, doesn't do anything to your body directly). It's actually a popularly recommended method among euthanasia advocates and as far as I can tell is the quickest, most painless, most peaceful way to (CW) commit suicide. If I eventually do it, it's probably going to be with that method, but with Helium since it's much easier to get.
With all that said, nitrogen shouldn't cause the reactions described, so I have no idea how they happened. My best guess is that it was his last (purposeful, not instinctive) attempt at saving himself. Which seems like it would be present in every method where they're conscious at the start. But that doesn't fully match with the "spasms and seizure-like movements".
Regardless, while it's probably the best method for someone who wants to die, clearly it doesn't seem great for executions. Of course executions aren't great in the first place, but one where the person is at least quickly anesthetized might be the least inhumane.
Edit: maybe he wasn't thrashing purposefully, but rather tried to hold his breath (or both), which meant the nitrogen didn't quickly replace the CO2, so he experienced the typical form of asphyxiation before the nitrogen could do anything. That would explain the deep gasping breaths at the end, he couldn't hold it any longer. That also explains why he was alive and moving for at least two minutes. Inert gas asphyxiation is supposed to be quicker than that afaik.
spoiler
I guess a potential "solution" (other than not executing people in the first place) could be to put the tube directly in their mouth in some way that they can't remove it. It would probably be pretty uncomfortable, but not necessarily painful. But I guess it might appear a little brutal.And they might fight against having it put in their mouth, but that seems like a problem for literally any execution method.
Edit: or just anesthetize them first. Is there a way to anesthetize that can't be resisted with painful results?