Least Squares FIR for Type II
I may have fond the answer. The $Q$ matrix, made from the sum of the Hankel and Toeplitz forms, stems from:

$$cos(k\omega)cos(n\omega) = \frac{1}{2}\left[cos((k-n)\omega)+cos((k+n)\omega)\right]$$

but with the additional $0.5$ for even orders, it comes out as:

$$cos((k+0.5)\omega)cos((n+0.5)\omega)=\frac{1}{2}\left[cos((k-n)\omega)+cos((k+n+1)\omega)\right]$$

and since the $k+n$ term makes the Hankel matrix, it needs an increment in its indices, and the $q$ vector longer by 1. The $b$ vector only needs the extra $0.5$. Now the relevant code lines look like this:

q = [wp + K*(1 - ws), wp*sinc(wp.*n) - K*ws*sinc(ws.*n)];
Q = (toeplitz(q(m + 1)) + hankel(q(m + 1 + oddN), q(m + M + 1 + oddN)));
b = wp*sinc(wp.*(m + 0.5*(~oddN)))';


and this is a comparison between a 30th and a 31st orders, with f=[0 0.3 0.4 1], A=[1 1 0 0], K=[1 10]:



What I don't understand now is why the $q$ vector is not made with the $0.5$ sampling offset.