Ignoring quantisation noise, if you anti alias filter a signal at 2x the nyquist rate and then sample at 2x the nyquist rate then you capture twice the bandwidth of thermal noise. The discrete signal power remains the same because the PSD of the signal doubles but it is averaged over 2x as many samples, half of which are equal to 0. The discrete noise PSD remains the same but is now present over 2x as many samples, therefore the noise power is double. The SNR therefore halves.
If you reconstruct the signal above after filtering and oversampling, as you increase the oversampling factor (with anti aliasing filter to half this sampling frequency) the signal power doesn't change, the noise power doesn't change, the PSDs are $T_s = 2\pi/f_s$ times greater than the discrete PSDs in the event that a brick wall filter is used. As continuous power is the integral of the PSD of the reconstructed signal, the power of noise is double when the sampling rate doubles as it has double the bandwidth, but the power of the signal remains the same. Continuous SNR also halves when the sampling rate doubles. The $2\pi$ factor introduced by multiplying by $T_s$ is normalised by $1/2\pi$ in the continuous power formula.
$E_s/N_0$ is essentially the SNR of the symbol, within the symbol bandwidth, so the SNR if the signal were filtered to the symbol bandwidth before sampling or oversampling. SNR is 2x smaller than the $E_s/N_0$ when you oversample by a factor of 2. This is because only noise within the symbol bandwidth is considered.
Discrete $E_s$ is the sum of the PSD, and continuous $E_s$ is discrete $E_s$ multiplied by $T_s = 2\pi/f_s$ if using a brick wall filter. The sum of the signal PSD is always the same regardless of sampling rate and the sum of the noise PSD is the same because only the noise in the symbol samples are considered.
$N_0$ is the noise PSD when the time signal is complex because there's a $N_0/2$ noise added in the I time channel and $N_0/2$ added in the Q time channel. When this is demodulated to baseband, if the negative half of the frequency spectrum is not the complex conjugate of the positive half and contains useful data, then the bandwidth is considered to be B and not 2B because there's is no mirror of B, and the noise PSD is $N_0$, but if it is the complex conjugate then the other half is considered to be a mirror of B, the useful bandwidth, and therefore the bandwidth is denoted 2B with $N_0/2$ noise (which almost never happens for a complex signal, because usually complex exponentials are used meaning there is no image). The 'complex baseband' matlab depiction with $N_0$ PSD has no mirror, though visually misleading, and the bandwidth is $B$ and not $2B$. Furthermore, if only a real channel is used, when it is demodulated (with just cos) you end up with $N_0/2$ and a $B$ bandwidth, or $N_0/4$ with a $2B$ bandwidth.
I postulate 2 reasons for this difference in the real and complex matlab definition:
For a real signal $E_s$ is half that of a complex signal, but $N_0$ is still referring to $N_0$ and not the actual noise $N_0/2$
It may be that $N_0$ is referring to $N_0/2$ but it is only taking into consideration the signal in the useful symbol bandwidth $E_s/4$ and not the full symbol bandwidth, but the noise in the full symbol bandwidth $N_0/4 + N_0/4 = N_0/2$ and comparing those.