My rationale was the following. If $n$ is even, then
$$n \mid x - a \implies n \mid x - a - n \implies n \mid \frac{1}{2} (x - a - n) \implies 2n \mid x - a - n $$
so $x \equiv a + n \pmod{2n}$. On the other hand, if $n$ is odd, $(n:2)=1$. Hence the Chinese remainder theorem guarantees that the linear congruence system
$$\begin{cases} x \equiv a \pmod{n} \\ x \equiv a \pmod{2} \end{cases}$$
has a unique solution modulo $2n$. We know the solution is $x \equiv a(2+n) \mod{2n}$, which is congruent to $n \equiv a(2 - n) \pmod{2n}$.
Given that $n$ is odd, $(2+n:2-n)=1$. Therefore $x \equiv a \pmod{2n}$.
Is this more or less correct?