Prove the asymptotic for the sum $\sum_{d\mid n}\frac{\mu(d)\ln(d)}{d}=O(\ln(\ln(n)))$

I don't know about your proof, but here is a proof. Let $f(n):=\sum_{d|n}\frac{\mu(d)\ln(d)}d$ and $g(n):=\sum_{d|n}\frac{\mu(d)}d$. Let us first study $g(n)$. For $p$ prime and not a divisor of $n$, we have \begin{align} g(np^k)&=\sum_{d|np^k}\frac{\mu(d)}d\\ &=\sum_{d|n}\left(\frac{\mu(d)}d+\frac{\mu(dp)}{dp}+...+\frac{\mu(dp^k)}{dp^k}\right)\\ &=\sum_{d|n}\left(\frac{\mu(d)}d-\frac{\mu(d)}{dp}\right)\\ &=\left(1-\frac1p\right)g(n) \end{align} so $|g(np^k)|\leq|g(n)|$. By induction, we have $|g(n)|\leq1$ for all $n$.

Now let us study $f(n)$. For $p$ prime and not a divisor of $n$, we have \begin{align} f(np^k)&=\sum_{d|np^k}\frac{\mu(d)\ln(d)}d\\ &=\sum_{d|n}\left(\frac{\mu(d)\ln(d)}d+\frac{\mu(dp)\ln(dp)}{dp}+...+\frac{\mu(dp^k)\ln(dp^k)}{dp^k}\right)\\ &=\sum_{d|n}\left(\frac{\mu(d)\ln(d)}d-\frac{\mu(d)(\ln(d)+\ln(p))}{dp}\right)\\ &=\left(1-\frac1p\right)f(n)-\frac{\ln(p)}pg(n) \end{align} so $|f(np^k)|\leq|f(n)|+\frac{ln(p)}p|g(n)|\leq|f(n)|+\frac{\ln(p)}p$.

By induction, for any $n$ with prime divisors $p_1,...,p_\ell$ we get $|f(n)|\leq\frac{\ln(p_1)}{p_1}+...+\frac{\ln(p_\ell)}{p_\ell}$.

In order to make this upper bound on $|f(n)|$ as large as possible while keeping $n$ as small as possible, it is clear we need to choose $n=p_1p_2...p_\ell$ where $p_1<...<p_\ell$ are the first $\ell$ primes. We find \begin{align} |f(n)|&\leq\sum_{i=1}^\ell\frac{\ln(p_i)}{p_i}\\ &\leq\sum_{i=1}^{p_\ell}\frac{\ln(i)}i\\ &\leq\int_{x=1}^{p_\ell}\frac{\ln(x)}x\ \mbox{d}x+C \end{align} where $C$ is some constant, which is necessary, because $x\mapsto\ln(x)/x$ is only decreasing for $x>e$. From this we get $|f(n)|=\mathcal{O}(\ln^2(p_\ell))$.

We note that $n=p_1p_2...p_\ell\geq2^\ell$, so $\ell=\mathcal{O}(\ln(n))$. By the prime number theorem, we furthermore get $p_\ell=\mathcal{O}(\ell\ln(\ell))=\mathcal{O}(\ln(n)\ln(\ln(n)))$. From this we get $|f(n)|=\mathcal{O}(\ln^2(\ln(n)\ln(\ln(n))))=\mathcal{O}(\ln^2(\ln(n))$.

But we can do better. First, note that, heuristically speaking, the probability of some natural number $i$ being prime is $1/\ln(i)$, by the prime number theorem. So a more accurate estimation would have been \begin{align} |f(n)|&\leq\sum_{i=1}^\ell\frac{\ln(p_i)}{p_i}\\ &=\mathcal{O}\left(\sum_{i=1}^{p_\ell}\frac1{\ln(i)}\cdot\frac{\ln(i)}i\right)\\ &=\mathcal{O}(\ln(p_\ell)). \end{align} From this, with the same steps as above, we get $|f(n)|=\mathcal{O}(\ln(\ln(n)))$.

To make this argument rigorous, you can use the prime number theorem to prove that $$\left|\{p\ \mbox{prime}:n\leq p<2n\}\right|=\mathcal{O}\left(\frac{n}{\ln(n)}\right).$$ Then let $N=2^t$ be the smallest power of two greater than $p_\ell$. We get \begin{align} |f(n)|&\leq\sum_{i=1}^\ell\frac{\ln(p_i)}{p_i}\\ &\leq\sum_{i=1}^{t-1}\sum\left\{\frac{\ln(p)}p:p\ \mbox{prime},2^i\leq p< 2^{i+1}\right\}\\ &=\mathcal{O}\left(\sum_{i=1}^{t-1}\frac{2^i}{\ln(2^i)}\cdot\frac{\ln(2^i)}{2^i}\right)\\ &=\mathcal{O}(t). \end{align} Since $t=\mathcal{O}(\ln(p_\ell))$, we can use the same argument again to get $|f(n)|=\mathcal{O}(\ln(\ln(n)))$.


$$a(n)=\sum_{d | n} \frac{\mu(d)\log d}{d} $$

If $p \nmid n$ then $$a(n p^k) = a(np) = \sum_{d | n}\frac{\mu(d)\log d}{d} + \sum_{d |n}\frac{\mu(dp)\log dp}{dp}= a(n) (1-\frac1p)-\frac{\log p}p \sum_{d | n} \frac{\mu(d)}{d}$$ $$=a(n) (1-\frac1p)-\frac{\log p}p \prod_{q|n} (1-q^{-1})$$

And hence $$|a(np^k)|\le |a(n)| + \frac{\log p}p $$

$$\implies |a(n)|\le \sum_{p | n} \frac{\log p}{p} $$ From Mertens theorems, taking the least primorial $k\# \ge n $ so that $ k \le C \log n$ we obtain $$|a(n)| \le \sum_{p | \ k\#} \frac{\log p}{p} = O(\log k)= O(\log \log n)$$