As in the solution of the problem: with $t=\tan\theta$, de Moivre's formula (Theorem 138) gives $\cos8\theta=\cos^8\theta\cdot\mathrm{Re}(1+it)^8$, that is, \[\cos8\theta=\cos^8\theta\left(1-28t^2+70t^4-28t^6+t^8\right).\] For $\theta=\frac{(2k-1)\pi}{16}$, $\cos8\theta=0$ and $\cos\theta\ne0$, so $u=t^2$ satisfies $u^4-28u^3+70u^2-28u+1=0$.
The four values $\tan^2\frac{\pi}{16},\dots,\tan^2\frac{7\pi}{16}$ are distinct, so they are exactly the four roots.
By Vieta (Theorem 139), their sum is $\boxed{28}$.