There is no need for numerical computation here.
First, $T(q)$ is a well-known function, the logarithmic integral. Repeated integration by parts gives an asymptotic expansion
$$\mathrm{Li}(q) = \frac{q}{\log q}\sum_{k=0}^{K-1} \frac{k!}{\log^k q} + O\left(\frac{q}{\log^{K+1}q}\right).$$
There's also a fairly rapidly convergent representation due to Ramanujan which you can find on Wikipedia
Second, regarding the main integral, it has a different asymptotic. First, $\sin^2\theta = \frac{1-\cos(2\theta)}{2}$, we remove the $\frac{q-2}{2}$ coming from the constant and concentrate on getting cancellation in the oscillatory part. Second, recall the digamma function (the logarithmetic derivative of the gammafunction) $\digamma(x) = \frac{\Gamma'(x)}{\Gamma(x)}$ which satisfies $\log x - \frac{1}{x}\leq\digamma(x) \leq \log x - \frac{1}{2x}$ and $\digamma'(x) = \frac1x + \frac{1}{2x^2} +O(x^{-3})$
Letting $u = \frac{\Gamma(x)}x$ we have $\frac{du}{u} = d(\log u) = (\digamma(x)-\frac1x)dx$ so that
$$\begin{split}\frac{q-2}{2} - S(q) &= \int_{x=2}^{x=q} \cos\left(\pi\frac{\Gamma(x)}{2x}\right)dx \\
&= \int_{x=2}^{x=q} \frac{\cos(\pi u)}{u}\frac{du}{\digamma(x)-\frac1x}
\end{split}$$
We now integrate by parts and get
$$\begin{split} &= \left[-\frac{\sin(\pi u)}{\pi u}\frac{1}{\digamma(x)-\frac1x}\right]_{x=2}^{x=q} - \int_{x=2}^{x=q} \frac{\sin(\pi u)}{\pi u^2}\frac{du}{\digamma(x)-\frac1x} \\
&- \int_{x=2}^{x=q} \frac{\sin(\pi u)}{\pi u}\frac{\digamma'(x)+\frac1{x^2}}{\left(\digamma(x)-\frac1x\right)^2} \frac{dx}{du}du \\
& = \left[-\frac{\sin(\pi u)}{\pi u}\frac{1}{\digamma(x)-\frac1x}\right]_{x=2}^{x=q} - \int_{x=2}^{x=q} \frac{\sin(\pi u)}{\pi u^2}\frac{du}{\digamma(x)-\frac1x} \\
&- \int_{x=2}^{x=q} \frac{\sin(\pi u)}{\pi u}\frac{\digamma'(x)+\frac1{x^2}}{\left(\digamma(x)-\frac1x\right)^3} du
\end{split}$$
The first term is $O(1) + O\left(\frac{q}{\Gamma(q)}\right)$ and in particular is bounded. The second is similarly $O\left(\int_{x=2}^{x=q} \frac{du}{u^2}\right) = O(1)+ O\left(\frac{q}{\Gamma(q)}\right)$. For the last term divide the interval into two parts: up to $2\leq x\leq q^\delta$ and $q^\delta \leq x \leq q$ for some $\delta < 1$. On the first interval we use that $\digamma'(x)+\frac1{x^2} = O(\frac{1}{x}) = O(1)$ to bound the integral as $O(1)+O(\log u(q^\delta) = O(\log(\Gamma(q^\delta)) = O(\delta q^\delta \log q)$. On the second interval we have $\digamma'(x)+\frac1{x^2} = O(q^{-\delta})$ so the whole integral is $O(q^{1-\delta}\log q)$. Taking $\delta = \frac12$ we conclude that
$$ S(q) = \frac{q-2}{2} + O(q^{1/2}\log q)$$
And in particular has a different asymptotic.
Finally, a more careful analysis using the $\log^3x $ in the denominator of the third term would give the error term $O\left(\frac{q^{1/2}}{\log^2 q}\right)$.