Second Order GL term
The total second order term $r(q) |\rho_q|^2$ in GL comes form the direct Coulomb repulsion between the ions as well as from the interaction mediated by fully or partially delocalized electrons. It would seem then that the interaction is simply the screened Coulomb. This would lead, however, to a paradoxical conclusion that crystals cannot be stable, since Coulomb screened by nearly free electrons is repulsive and hence ions should fly apart.
The resolution of this apparent paradox is that while considering the stability of solids one cannot think of electrons as an almost free Fermi gas. Instead, the solids emerge near the crossover between atomic and delocalized limits. Bringing neutral atoms together reduces electronic kinetic energy when the electronic orbitals begin to overlap; however, when atoms are brought too close together, high electronic Fermi pressure pushes the crystal apart. That means, that the derivation of interaction from the nearly free-electron limit is not technically correct. Still, we will calculate it since the procedure is analogous to the one that we use to calculate 3rd and 4th order in density terms of GL.
$$\Omega^{(2)}= \frac{|v_q \rho_{q}|^2}{2 \beta} \sum_{\omega_n, p} G_p(\omega_n) G_{p-q}(\omega_n) = \frac{|v_q \rho_{q}|^2}{2 \beta} \sum_{\omega_n, p} \frac{1}{i\omega_n - \epsilon_p} \frac{1}{i\omega_n - \epsilon_{p-q}} \\ = \frac{|v_q \rho_{q}|^2}{2} \sum_{ p} \frac{n_F(\epsilon_p) - n_F(\epsilon_{p-q})}{\epsilon_p - \epsilon_{p-q}}.$$
The sum equals the minus static electronic susceptibility at wave vector $q$. The expression is clearly negative, so the energy of the ionic system is lowered by this contribution. The susceptibility of free electrons in 2d is constant up to $2k_F$ and then decreases (see attachment); in 3D it peaks at $q = 0$. In combination with the direct ion-ion Coulomb interaction, this contribution may define an optimal ordering wave vector. This would be a valid approximation if electrons themselves were non-interacting. However, since electrons interact equally well among themselves, the correct approach should include that interaction as well, making analysis based on the second order perturbation theory unreliable.
Therefore, in what follows, we will phenomenologically take the second order free energy as
$$\Omega^{(2)}= r_q |\rho_{q}|^2$$
with $r_q = \alpha (q^2 - q_0^2)^2$, where $\alpha$ and $q_0$ cannot be simply deduced from the electronic susceptibility and bare or simply screened Coulomb.