Here's an alternative argument based on the Peter-Weyl theorem. 1) if $G$ is a connected compact Lie group, it has a bi-invariant Riemannian metric, which induces a bi-invariant distance. 2) if $G$ is a compact Lie group, choose a distance as in (1) on $G^0$, normalized so that the diameter is $\le 1$; extend it by left translation on each component, and say that any two points in different components have distance 1. This is a bi-invariant distance inducing the topology. 3) if $G$ is a product $\prod_nG_n$ of a sequence $(G_n)$ of compact Lie groups, choose a bi-invariant distance $d_n$ on $G_n$ of diameter $\le 1$ inducing the topology of $G_n$: then $d(g,h)=\sum_n2^{-n}d(g_n,h_n)$ is a bi-invariant distance inducing the topology of $G$. 4) if $G$ is an arbitrary compact metrizable topological group, it embeds, by the Peter-Weyl theorem, as a closed subgroup of $\prod_nG_n$ for some sequence $(G_n)$ of compact Lie groups. Using (3) and restricting, we get a bi-invariant distance on $G$ inducing the topology.