Suppose Bezout is $\,d\, =\, 0\cdot n_1 +\, \cdots\, + 0\cdot n_j\, +\, a_{j+1}\, n_{j+1} + \cdots + a_k\, n_k,\, $ all $\,a_i \neq 0,\ j\ge 1$.
Choose $a_1\!\neq 0\,$ so $\,1 + a_1 n_1 + n_2 + \cdots + n_j =: c \ne 0.\ $ Multiply above Bezout equation by this
which yields that $\, d + d a_1 n_1\! + dn_2 + \cdots + dn_j =\, c a_{j+1}\, n_{j+1} + \cdots + c a_k\, n_k\,$ with all coef's $\neq 0$.
Here's a somewhat different approach. First, similar to what you did, the "if" part means each prime factor of $m$ is congruent to $1 \pmod{4}$. As shown in the answer to Sum of two squares and prime factorizations, Fermat's theorem on the sum of squares states each prime factor $p_i$ of $m$ can be written as the sum of squares. Also, for any $c, d, e, f \in \mathbb{R}$,
$$(c^2 + d^2)(e^2 + f^2) = (ce \pm df)^2 + (cf \mp de)^2 \tag{1}\label{eq1A}$$
shows whenever $2$ numbers can be written as a sum of squares, their product can be as well, in $2$ different ways. Using \eqref{eq1A} repeatedly with the previous result (starting at $1$) and for each $p_i \mid m$ means the final product, i.e., $m$, can be written as a sum of squares.
Regarding proving you can choose an $a$ and $b$ where $\gcd(a, b)$, the answer to Any product of primes in the form of 4n+1 is the sum of 2 relatively prime squares shows this, paraphrased below.
As shown in \eqref{eq1A}, the product of the $2$ sums of squares can be expressed in $2$ ways. Have $c^2 + d^2$, with $\gcd(c, d) = 1$, be a product of $1$ or more primes of the form $4n + 1$, and $e^2 + f^2$ be a prime of that form to be multiplied. Consider if the first form in \eqref{eq1A}, i.e., $(ce + df)^2 + (cf - de)^2$, is not valid, i.e., there's a prime $q$ which divides each term. This means
$$q \mid (ce + df)e + (cf - de)f = c(e^2 + f^2) \tag{2}\label{eq2A}$$
$$q \mid (ce + df)f - (cf - de)e = d(e^2 + f^2) \tag{3}\label{eq3A}$$
Since $q$ doesn't divide $c$ and $d$, then $q \mid e^2 + f^2 \implies q = e^2 + f^2$. If both solution types in \eqref{eq1A} are not valid, then $e^2 + f^2$ divides $ce - df$ as well as $ce + df$, and hence divides $2ce$ and $2df$. Since $e^2 + f^2$ doesn't divide $2e$ or $2f$, it must divide both $c$ and $d$, contrary to the hypothesis, meaning at least one of the $2$ forms must be valid. Thus, use the valid form, and repeat this procedure for each prime that is multiplied, to eventually get $m$.
For the "only if" part, similar to the answer to If $a \in \Bbb Z$ is the sum of two squares then $a$ can't be written in which of the following forms?, suppose there's a prime $p \equiv 3 \pmod{4}$ with $p \mid m$. If $p \mid a$, then $p \mid b$, and vice versa, but since $\gcd(a, b) = 1$, then $p$ can't divide either $a$ or $b$. Thus, $a$ has a multiplicative inverse, call it $a'$, modulo $p$. Let $r = \frac{p-1}{2}$ and note $r$ is odd. Also using Fermat's little theorem, this gives (note the argument below is basically equivalent to showing $-1$ is not a quadratic residue modulo $p$ if $p \equiv 3 \pmod{4}$)
$$\begin{equation}\begin{aligned}
a^2 + b^2 & \equiv 0 \pmod{p} \\
a^2(a')^2 + b^2(a')^2 & \equiv 0 \pmod{p} \\
1 + (ba')^2 & \equiv 0 \pmod{p} \\
(ba')^2 & \equiv -1 \pmod{p} \\
\left((ba')^2\right)^{r} & \equiv (-1)^r \pmod{p} \\
(ba')^{p-1} & \equiv -1 \pmod{p} \\
1 & \equiv -1 \pmod{p}
\end{aligned}\end{equation}\tag{4}\label{eq4A}$$
This, of course, is not possible, meaning the original assumption must be false. This confirms all prime factors of $m$ must be congruent to $1 \pmod{4}$.
Best Answer
In any base $b$, we can see that a number is of the form $a=\sum d_ib^i$ for digits $d_i$. We also know that $b^i \equiv 1 \pmod{b-1}$. Thus, we can conclude that in base $b$, the sum of the digits of a number $a$ leaves the same remainder as $a$, when divided by $b-1$. In notation- $$a \equiv D(b,a) \pmod{b-1}$$ If we have $g=\gcd(n_0,n_1,\ldots,n_u,a)$, then we can see that $g \mid n_i^{m_i}$. We also know $$D(a+1,n_i^{m_i}) \equiv n_i^{m_i} \pmod{a} \implies g \mid D(a+1,n_i^{m_i})$$ because $g$ divides both $n_i^{m_i}$ and $a$. Since $g$ divides all of $D(a+1,n_i^{m_i})$, it divides their greatest common divisor. This concludes the proof.