Is the following sketch of a proof of "$K(G,n)$ represents $H^n(-;G)$" correct? I feel like it should be well-known, but my search didn't find anything.
Suppose $X$ is a CW complex. Singular cohomology is, by definition, $H^*(S_{Ab}(X),G)$ where $S_{Ab}(X)$ is the simplicial abelian group generated by the singular set of $X$. This is equivalent to $[S_{Ab}(X),G(n)]$ where $[-,-]$ denotes chain homotopy classes of maps and $G(n)$ is the chain complex with $G$ in the nth degree and 0 elsewhere.
Under the Dold-Kan correspondence $\Gamma: Ch^+ \rightarrow s\bf{Ab}$, this corresponds to the set $[\Gamma(S_{Ab}(X)),\Gamma(G(n))]$ (maps under simplicial homotopy equivalence) where presumably the thing on the left is weakly equivalent to $X$ after realization and the thing on the right is a $K(G,n)$ after realization. By the equivalence of $\operatorname{Ho}(Top)$ and $\operatorname{Ho}(SSet)$, geometric realization gives an isomorphism between the set of simplicial homotopy classes of maps and the homotopy classes of maps of its realization, so we are done.