I think the answer (up to a multiplicative constant) is what you discovered, $f(n)=\sqrt{\log\log n}$. Obviously you can assume that $\chi$ is not a principal character since in that case you get something less than $1$. Then after writing
$$\sum_{d|n}\frac{\mu (d)\chi(d)}{d}=\prod_{p|n}\left(1-\frac{\chi (p)}{p}\right)$$and taking the logarithm of the RHS the problem boils down to finding an upper bound for the real part of the sum
$$\sum_{p|n}\frac{-\chi (p)}{p}.$$
The values of $\chi (d)$ are symmetric about the imaginary axis so the worst thing that could happen here is to have half of the values equal to $-1$ (e.g. use the Legendre symbol modulo some prime $q$) and then suppose that $n$ is a product of all primes up to some point which fall in the residue classes $d$ for which $\chi (d)=-1$. By Dirichlet's Theorem this accounts for half of the primes, evenly distributed in the various residue classes, and translating everything back to the original formulation (i.e. using the prime progression version of Merten's Theorem and then exponentiating, as you have obviously done in your example) gives the upper bound that you found.