[proofplan]
We rewrite the short sum by grouping integers in $I$ according to their residue class modulo $q$. The residue-counting function is then expressed by the elementary orthogonality relation for additive characters modulo $q$, proved directly by summing a finite geometric progression. Substituting this expression into the grouped sum and interchanging finite sums leaves exactly the stated Fourier coefficient $\hat F(a)$.
[/proofplan]
[step:Check that the exponential factors are well-defined on residue classes]
Let $a,x\in\mathbb Z/q\mathbb Z$, and let $\tilde a,\tilde a',\tilde x,\tilde x'\in\mathbb Z$ be representatives of $a,a,x,x$, respectively. Then $q\mid(\tilde a'-\tilde a)$ and $q\mid(\tilde x'-\tilde x)$. Hence, for every $n\in\mathbb Z$,
\begin{align*}
\frac{\tilde a'n}{q}-\frac{\tilde an}{q}\in\mathbb Z.
\end{align*}
Since $e(t+m)=e(t)$ for all $t\in\mathbb R$ and $m\in\mathbb Z$, the quantity $e(\tilde a n/q)$ depends only on $a$.
Similarly,
\begin{align*}
\frac{\tilde a'\tilde x'}{q}-\frac{\tilde a\tilde x}{q}=\frac{(\tilde a'-\tilde a)\tilde x'}{q}+\frac{\tilde a(\tilde x'-\tilde x)}{q}\in\mathbb Z.
\end{align*}
Thus $e(-\tilde a\tilde x/q)$ depends only on $a$ and $x$. Therefore $C(a)$ and $\hat F(a)$ are well-defined functions of residue classes.
[/step]
[step:Group the short sum by residue class]
Define the residue-counting function
\begin{align*}
N_I:\mathbb Z/q\mathbb Z\to\mathbb Z_{\ge 0}
\end{align*}
by
\begin{align*}
N_I(x):=\#\{n\in I:\bar n=x\}.
\end{align*}
Because $I$ is finite, all sums below are finite. Grouping the terms in $S_I(F;q)$ according to the value of $\bar n$ gives
\begin{align*}
S_I(F;q)=\sum_{x\in\mathbb Z/q\mathbb Z}F(x)N_I(x).
\end{align*}
[/step]
[step:Express the residue-counting function by additive character orthogonality]
For $r\in\mathbb Z$, define
\begin{align*}
A_q(r):=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}e\left(\frac{\tilde a r}{q}\right),
\end{align*}
where $\tilde a\in\mathbb Z$ is any representative of $a$. The preceding well-definedness argument shows that $A_q(r)$ is independent of the representatives. We claim that $A_q(r)=1$ if $q\mid r$, and $A_q(r)=0$ if $q\nmid r$.
If $q\mid r$, then $e(\tilde a r/q)=1$ for every $a\in\mathbb Z/q\mathbb Z$, so $A_q(r)=q^{-1}q=1$. If $q\nmid r$, put $\zeta:=e(r/q)$. Then $\zeta\ne 1$ and $\zeta^q=e(r)=1$. Choosing the representatives $0,1,\dots,q-1$ for the residue classes gives
\begin{align*}
qA_q(r)=\sum_{a=0}^{q-1}\zeta^a=\frac{1-\zeta^q}{1-\zeta}=0.
\end{align*}
This also covers $q=1$, since then the only residue class is $0$ and $A_1(r)=1$ for every $r\in\mathbb Z$.
Now fix $x\in\mathbb Z/q\mathbb Z$ and let $\tilde x\in\mathbb Z$ be a representative of $x$. For each $n\in I$, the condition $\bar n=x$ is equivalent to $q\mid n-\tilde x$. Therefore the orthogonality relation gives
\begin{align*}
N_I(x)=\sum_{n\in I}A_q(n-\tilde x).
\end{align*}
Expanding the definition of $A_q$ and interchanging the finite sums, we obtain
\begin{align*}
N_I(x)=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}\sum_{n\in I}e\left(\frac{\tilde a(n-\tilde x)}{q}\right).
\end{align*}
For each fixed $a$, multiplicativity of the exponential gives
\begin{align*}
\sum_{n\in I}e\left(\frac{\tilde a(n-\tilde x)}{q}\right)=e\left(-\frac{\tilde a\tilde x}{q}\right)\sum_{n\in I}e\left(\frac{\tilde a n}{q}\right)=e\left(-\frac{\tilde a\tilde x}{q}\right)C(a).
\end{align*}
Thus
\begin{align*}
N_I(x)=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}C(a)e\left(-\frac{\tilde a\tilde x}{q}\right).
\end{align*}
[guided]
The goal of this step is to replace a congruence condition by a finite Fourier average. Define
\begin{align*}
A_q(r):=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}e\left(\frac{\tilde a r}{q}\right)
\end{align*}
for $r\in\mathbb Z$, where $\tilde a$ is any integer representative of $a$. This is well-defined because changing $\tilde a$ by a multiple of $q$ changes $\tilde a r/q$ by an integer, and $e$ is periodic with period $1$.
We now compute $A_q(r)$. If $q\mid r$, then $\tilde a r/q\in\mathbb Z$ for every residue class $a$, so every summand is $1$. Hence
\begin{align*}
A_q(r)=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}1=1.
\end{align*}
If $q\nmid r$, set $\zeta:=e(r/q)$. Then $\zeta^q=e(r)=1$, while $\zeta\ne 1$ because $r/q\notin\mathbb Z$. Using the representatives $0,1,\dots,q-1$, the sum is a finite geometric progression:
\begin{align*}
qA_q(r)=\sum_{a=0}^{q-1}\zeta^a=\frac{1-\zeta^q}{1-\zeta}=0.
\end{align*}
Therefore $A_q(r)=0$ when $q\nmid r$. In the edge case $q=1$, there is only one residue class and $A_1(r)=1$ for all $r\in\mathbb Z$, which is exactly the same conclusion because $1\mid r$ for every integer $r$.
Now fix a residue class $x\in\mathbb Z/q\mathbb Z$ and choose a representative $\tilde x\in\mathbb Z$. The function $N_I(x)$ counts precisely those $n\in I$ with $\bar n=x$. This condition is equivalent to $q\mid n-\tilde x$. The computation of $A_q$ therefore turns the indicator of the congruence condition into an additive-character average:
\begin{align*}
N_I(x)=\sum_{n\in I}A_q(n-\tilde x).
\end{align*}
Substituting the definition of $A_q$ gives
\begin{align*}
N_I(x)=\sum_{n\in I}\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}e\left(\frac{\tilde a(n-\tilde x)}{q}\right).
\end{align*}
The set $I$ and the residue ring $\mathbb Z/q\mathbb Z$ are finite, so interchanging the two sums requires no convergence theorem:
\begin{align*}
N_I(x)=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}\sum_{n\in I}e\left(\frac{\tilde a(n-\tilde x)}{q}\right).
\end{align*}
For fixed $a$, split the exponential using $e(u+v)=e(u)e(v)$:
\begin{align*}
\sum_{n\in I}e\left(\frac{\tilde a(n-\tilde x)}{q}\right)=e\left(-\frac{\tilde a\tilde x}{q}\right)\sum_{n\in I}e\left(\frac{\tilde a n}{q}\right).
\end{align*}
The last sum is exactly $C(a)$ by definition. Hence
\begin{align*}
N_I(x)=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}C(a)e\left(-\frac{\tilde a\tilde x}{q}\right).
\end{align*}
[/guided]
[/step]
[step:Substitute the completed form of $N_I$ and identify the Fourier coefficient]
Substituting the formula for $N_I(x)$ into the grouped expression for $S_I(F;q)$ gives
\begin{align*}
S_I(F;q)=\sum_{x\in\mathbb Z/q\mathbb Z}F(x)\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}C(a)e\left(-\frac{\tilde a\tilde x}{q}\right).
\end{align*}
Since both sums are finite, we may interchange their order:
\begin{align*}
S_I(F;q)=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}C(a)\sum_{x\in\mathbb Z/q\mathbb Z}F(x)e\left(-\frac{\tilde a\tilde x}{q}\right).
\end{align*}
For each $a\in\mathbb Z/q\mathbb Z$, the inner sum is $\hat F(a)$ by definition. Therefore
\begin{align*}
S_I(F;q)=\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}C(a)\hat F(a),
\end{align*}
which is the desired completion formula.
[/step]