For $n=1$ we have $2S(n) = 2$. For $n> 1$ and a number $1\leq a\leq n$ relatively prime with $n$, so is $n-a$. Therefore $2S(n) = n\varphi(n)$, where $\varphi$ is Euler's totient function.
a) $2$ is not a perfect square (for $n=1$). $2S(n)$ is not a perfect square, since if $k$ is the exponent of the largest prime $p$ that divides $n$, then $p$'s exponent in $2S(n)$ is $k + (k-1) = 2k-1$, odd.
b) For $m=2$, and $n= 2k - 1$, take $x = 2^{k}$, so $2S(x) = 2^{2k-1} = 2^n$. Most likely it can be arranged for $m$ any power of $2$, but for the other cases ... probably some reduction/induction, keeping multiplying $x$ by lower and lower primes than those dividing $m$, at convenient powers (to account for the contribution of $\varphi(x)$).