Why does the general formula for DFT of real sinusoids not apply here?
It's not a contradiction. It's just that for an alternating signal the two contributions at $\pm k_0$ coincide and add up. Note that in your example with $N=4$, you have $k_0=\pm 2$, but these two values of $k_0$ are in fact identical due to the periodicity of $N=4$: $X[-2]=X[2]$.

The same would be true for $k_0=0$, i.e. a constant signal (with frequency zero and amplitude $A_0$). In that case you'd get $X[0]=A_0N$, just like in the case of a signal at Nyquist (maximum frequency, as in your example) where you get $X[N/2]=A_0N$. For all other values of $k_0$ you get two contributions with amplitudes $A_0N/2$.

Regarding your second question, this is an identity that is very important in DSP. First of all note that due to periodicity of the complex exponential function you have the equality

$$\sum_{n=-N/2}^{N/2-1}e^{-j2\pi (k-k_0)n/N}=\sum_{n=0}^{N-1}e^{-j2\pi (k-k_0)n/N}\tag{1}$$

For $k=k_0$ the complex exponential in $(1)$ becomes $1$, so the sum equals $N\cdot 1=N$. For $k\neq k_0$ you can use the formula for the geometric series to see that

$$\sum_{n=0}^{N-1}e^{-j2\pi (k-k_0)n/N}=\frac{1-e^{-j2\pi (k-k_0)}}{1-e^{-j2\pi (k-k_0)/N}}=0\tag{2}$$

because for $k\neq k_0$ we have $e^{-j2\pi (k-k_0)}=1$.