After staring at my question for a while, I think I can answer it partially. But not rigorously, so perhaps someone can improve it. Ramanujan's 4 kinds of pi formulas,
$$\frac{1}{\pi} = \sum_{n=0}^\infty s(n) \frac{An+B}{C^{n+1/2}}$$
for a defined integer sequence $s(n)$ have a general closed-form in terms of the hypergeometric function and Dedekind eta function. See this short article.
After some fiddling, it turns out $A$ can be nicely factored. For level $p=2$, define the eta quotient,
$$v:=v(\tau)=\frac{1}{2\sqrt{2}}\left(\frac{\eta(\tau)}{\eta(2\tau)}\right)^6\tag1$$
(similar to zy_'s answer), then,
$$A:= A(\tau) = 4\sqrt{d}\left(v-\frac{1}{v}\right)\left(v+\frac{1}{v}\right)\tag2$$
For example:
1. For $\tau=\tfrac{1}{2}\sqrt{-d},\;d=58$: $$v(\tau)=\Big(\tfrac{5+\sqrt{29}}{2}\Big)^3=\color{blue}{70}+\color{blue}{13}\sqrt{29}\tag3$$
so the two factors of $(2)$ explain,
$$A(\tau)=4\sqrt{58}\left(v-\frac{1}{v}\right)\left(v+\frac{1}{v}\right) = 16\sqrt{2}\cdot29\color{blue}{\cdot70\cdot13}$$
2. However, for $\tau=\tfrac{1}{2}(1+\sqrt{-d}),\;d=37:$
$$v(\tau)=\zeta^3\big(6+\sqrt{37}\big)^{3/2}\tag4$$
with root of unity $\zeta = e^{2\pi i/8}$, and cannot be expanded out like $(3)$, though $A(\tau)$ is still an integer (with the imaginary unit affixed),
$$A(\tau)=2^3\cdot5\cdot29\cdot37\,i$$
So while $(4)$ also involved a unit, namely $U_{37}$, I guess it was because $(3)$ was an integer power of the unit $U_{29}$ that made it different.
Not the complete answer, but at least a try.