Edit: I finally found the missing steps in my proof and understood my mistakes, see the comments and answer below. This question is now solved.
Let $n\geq 1$ and consider $G$ the group scheme over $\mathbb Z$ whose functor of points is given by $$G(R)=\{g\in GL_{2n}(R)|g^TJg=J\}$$ where $J=\left[ {\begin{array}{cc} 0 & I_n \\ -I_n & 0 \\ \end{array} } \right]$ and $R$ is any ring. This functor is easily seen to be representable by some affine scheme over $\mathbb Z$ of finite presentation. I would like to prove that it is smooth over $\mathbb Z$, and I figured that the easiest way would be to check the infinitesimal lifting criterion for smoothness. Could you please check my proof below and tell me if everything is ok ? Besides, would you have other ways/arguments to justify that $G$ is smooth ?
Because $G$ is a group-scheme, it is enough to prove that $G$ is smooth over $\mathbb Z[\frac{1}{2}]$. Indeed, $G$ has at least a point lying over a prime different from $2$ (eg. the identity lies over the zero ideal in $\operatorname{Spec}(\mathbb Z)$). Using translations in $G$, if it is smooth at a point, then it is smooth everywhere.
The lifting criterion is the following problem: given $A$ a (commutative) ring where $2$ is invertible, given $I\subset A$ an ideal with $I^2=0$, letting $A_0:= A/I$, I must check that the natural map $G(A)\rightarrow G(A_0)$ is surjective.
Consider $\tilde g\in G(A_0)$. First, any lift $g$ of $\tilde g$ to $M_{2n}(A)$ actually lies in $GL_{2n}(A)$. Indeed, the class of $\det g$ in $A_0$ is exactly the determinant of $\tilde g$, which is a unit in $A_0$. Thus, there exists some $x\in A$ and $i\in I$ such that $x\det g=1+i$. But then, I have $$x(1-i)\det g=(1-i)(1+i)=1$$ because $i^2=0$. Thus $\det g$ is always a unit in $A$.
Now, I fix a lift $g$ of $\tilde g$. There exists some matrix $X\in M_{2n}(A)$ with coefficients all lying in $I$, such that $g^TJg=J+X$. Taking the transpose of this equation, I see that $X$ must be antisymmetric, that is $X^T=-X$. I want to modify the lift $g$ so that I can kill $X$.
To do this, I consider $Y$ any matrix with coefficient in $I$ (that we will determine later), and replace $g$ by $g+Y$. I obtain $$(g+Y)^TJ(g+Y)=J+X + g^TJY + Y^TJg + \underbrace{Y^TJY}_{=0}$$ where I used again $I^2=0$. Thus, I want to choose $Y$ so that $X + g^TJY + Y^TJg=0$. This can be done, letting $Y=-\frac{1}{2}J^{-1}g^{-T}X$.
Hence, $g+Y \in G(A)$ is a preimage of $\tilde g$, as desired.
I consider the same setting as in my question above, except I make no more hypothesis on $A$: the number $2$ may not be invertible anymore.
The discussion remains unchanged and it all boils down to solving $X + g^TJY + Y^TJg=0$ with unknown $Y$ a matrix with coefficients in $I$, $g\in GL_{2n}(A)$ is fixed, and $X=g^TJg-J$ has coefficients in $I$ too.
Making the change of variable $Y=J^{-1}g^{-T}Y'$ and noticing that $J$ is antisymmetric, this reduces to the equation $$X=(Y')^T-Y'$$ with $Y'$ having coefficients in $I$. For $1\leq i,j \leq 2n$, this means $X_{i,j}=Y'_{j,i}-Y'_{i,j}$.
This system of equations can be solved. First, the expression $X=g^TJg-J$ implies that the diagonal entries of $X$ are zero, using definition of $J$. This is consistent with our equations. We let $Y'_{j,i}=X_{i,j}$ for $1\leq i\leq j \leq 2n$ and $Y'_{j,i}=0$ otherwise, so that $Y'$ is strict lower-triangular with coefficients in $I$. It is readily checked that this $Y'$ is solution of the above equation, noticing that $X$ is antisymmetric, that is $X_{i,j}=-X_{j,i}$.
This concludes the problem, and proves that $G\rightarrow \operatorname{Spec}(\mathbb Z)$ is smooth by the lifting criterion.