Based off your example for $n=4$, there should be an easy generalization for any $n\ge 3$, but I'll examplify using $n=5$ here.
Instead of letting the alphabet be $\{\mathrm{A,B,C,D,E}\}$, we instead use $\{0,1,2,3,4\}$ as they represent the 5 congruence classes of addition mod 5. Fix any two distinct permutations starting with $0$, say $(0,4,2,3,1)$ and $(0,2,4,3,1)$. For the addition table mod 5 using the two permutations as axes:
\begin{array}{c|ccccc}+&0&4&2&3&1\\\hline0&0&4&2&3&1\\2&2&1&4&0&3\\4&4&3&1&2&0\\3&3&2&0&1&4\\
1&1&0&3&4&2\\\end{array}
Now notice that each row or column is the corresponding initial permutation but added some constant to all terms. But each permutation $\sigma$ of $\{0,1,2,3,4\}$ is uniquely formed by (a) taking a unique corresponding permutation starting with 0, and (b) adding a fixed value from $\{0,1,2,3,4\}$ and then mod 5 to all terms of the starting permutation. For example,
\begin{equation}(2,3,1,0,4)\equiv(0,1,4,3,2)+2\pmod{5}\end{equation}
Thus if we take all $(n-1)!$ many permutations starting with 0, group them into pairs, and form corresponding addition tables mod $n$, then we necessarily get each permutation on $\{0,\ldots,n-1\}$ precisely once. In particular, the optimal number of squares is equal to $\frac{(n-1)!}{2}$ for all $n\ge 3$.