Hi
I am not an expert in the calculation of ionic liquid structure S(q). Maybe one of the following tools can help you.
gmx rdf calculates the rdf (then you can script the transformation to S(q) ) gmx rdf — GROMACS 2021 documentation
gmx sans calculate SANS spectra using Debye formula. and it ouput also S(q) gmx sans — GROMACS 2021 documentation
gmx saxs use Cromer’s method gmx sans — GROMACS 2021 documentation
I hope it helps
Alessandra