One way to look at the invariant symmetric forms is by noting that they describe one dimensional central extensions of the loop algebra $L\mathfrak{g} = \operatorname{Maps}(S^1, \mathfrak{g})$. As a vector space, you have a direct sum $L\mathfrak{g} \oplus \mathbb{R}K$, and in order to get a Lie algebra structure that has a Lie algebra surjection to $L\mathfrak{g}$ with central kernel, it is necessary and sufficient that the bracket restricted to the $L\mathfrak{g}$ summand be given by:
$$[f,g]_{\hat{\mathfrak{g}}} = [f, g]_{L\mathfrak{g}} - \phi(\operatorname{Res} fdg)K. $$
for some invariant form $\phi: \operatorname{Sym}^2 \mathfrak{g} \to \mathbb{R}$.
Given a pointed map $BG \to K(\mathbb{Z},4)$ (called the level), you can apply the loop space functor twice to get a two-fold loop map $\Omega G \to K(\mathbb{Z},2)$. Two-fold loop spaces (that are grouplike) are abelian groups up to homotopy, and two-fold loop maps are homotopy abelian homomorphisms. In this case, homotopy classes of two-fold loop maps classify the data of an $S^1$-bundle on the loop group, together with a multiplication that makes it a central extension, up to isomorphism. Delooping this twice gives you a correspondence with elements of $H^4(BG,\mathbb{Z})$.
Unfortunately, I am rather unfamiliar with the details of the remaining steps, namely switching to real coefficients, and passing from the loop group to its Lie algebra.