One can modify the approach of the linked solution. Borrowing the notation from there, we want the resulting matrix $A = (\det V) V \Lambda V^{-1}$ to satisfy $A^T = A$, and it is sufficient to choose $V$ such that $V^{-1} = V^T$, that is, such that $V$ is orthogonal. This actually gives only $n!$ solutions over $\Bbb Z$, namely the permutation matrices, and these only yield diagonal matrices, but we can just allow ourselves to work with rational orthogonal matrices $V$ and then clear denominators at the end. For $n \geq 2$ there are infinitely many of these, as any Pythagorean triple $(a, b, c)$ determines such a matrix:
$$\begin{pmatrix}\frac{a}{c} & -\frac{b}{c} \\ \frac{b}{c} & \frac{a}{c}\end{pmatrix} \oplus I_{n - 2} .$$ Alternatively, one could take a Householder reflection determined by any rational vector in $\Bbb Q^3$.
Explicitly:
- Pick any sequence $(d_1, \ldots, d_4)$ of nonnegative integers and form the diagonal matrix $$D := \pmatrix{d_1 & & \\ & \ddots & \\ & & d_4} .$$
- Pick any rational, orthogonal $4 \times 4$ matrix $Q \in SO(4, \Bbb Q)$.
- Form the rational matrix $Q D Q^{-1} = Q D Q^T$, and multiply by some positive multiple $m$ of the least common denominator of the entries of that matrix. By construction, the resulting matrix $A := m Q D Q^T$ is symmetric has integer entries and nonnegative eigenvalues $md_a$.
For example, consider the sequence $(2, 1, 1, 1)$ and for $Q$ take the above matrix given by the familiar Pythagorean triple $(a, b, c) = (3, 4, 5)$. Computing gives
$Q D Q^{-1} = \pmatrix{\frac{34}{25} & \frac{12}{25} \\ \frac{12}{25} & \frac{41}{25}} \oplus I_2$, and clearing denominators gives a matrix with the desired properties.
$$\pmatrix{34 & 12 & 0 & 0 \\ 12 & 41 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1} .$$