Group Delay of a system
The z domain transfer function  of the system is the z transform of the system impulse response, so start by taking the Z transform of h[n] ...

$$H[z] = -z^1 + 1 + 2z^{-1} + 2z^{-2}  + z^{-3} -z^{-4}$$

You may be able to message this into a nicer form, but that isn't necessary.

Next, to get the the frequency response, replace z with $e^{jw}$

So this yields $-e^{jw} + 1 + 2e^{-jw} + 2e^{-2jw}  + e^{-3jw} -e^{-4jw}$ which is a complex function with both a phase and a magnitude.

Find the phase of this expression and you are done.  I don't have time to wrestle this into Magnitude*phase form, so I'll go to your first example which is a simple case.

$$H[z] =  1 + z^{-4} $$
or
$$H[z] =  z^{-2}(z^2 + z^{-2}) $$
then you have
$$H[e^{jw}] =  e^{-j2w}(e^{j2w} + e^{-j2w}) = 2cos(2w)e^{-j2w} $$

Your phase is the argument of the complex exponential $e^{-j2w}$, so...

$\angle H(e^{jw})$ is the expression $-2w$