Discrete-time signals increase in frequency and period
You're right that the periods of the two signals are very different. The period of a sinusoidal sequence
$$x[n]=\cos(n\omega_0+\phi)\tag{1}$$
with $\omega_0=\pi/2$ equals $N=4$, whereas for $\omega_0=999\pi/1000$ it equals $N=2000$.
But this is not what &quot;frequency&quot; refers to here. Note that in general the sequence $x[n]$ as defined in $(1)$ isn't even periodic. It is only periodic if $\omega_0$ satisfies
$$\omega_0=\frac{2\pi p}{q},\qquad p,q\in\mathbb{Z}\tag{2}$$
Maximum frequency for a discrete-time signal is achieved if the samples alternate in sign. This is the case for $\omega_0=\pi$, and it is achieved for almost all samples if $\omega_0$ is close to $\pi$. For $\omega_0=\pi/2$ there are always two samples with the same sign before the sign changes, so the frequency is half of the frequency of a sequence for which consecutive samples have alternating signs.