Let me prove that for $G=\mathbb{Z}_p$$G=\mathbb{Z}_{p^s}$, $p$ is prime, we indeed have $q(G)=p-1=D(G)-1$$q(G)=p^s-1=D(G)-1$. It is again inclusion-exclusion, as for $p=2$$p^s=2$.
Let $\mathcal{A}$ be a union-closed family, assume that a function $\nu:[n]\rightarrow G$$\nu:[n]\rightarrow \mathbb{Z}$ satisfies the following condition: $S(A):=\sum_{x\in A} \nu(x)\ne 0$$p^s$ does not divide $S(A):=\sum_{x\in A} \nu(x)$ for any set $A\in {\mathcal A}$. If
We use the following polynomial $$ \varphi(x)=\binom{x-1}{p^s-1}+(-1)^{p^s}. $$ We have $\varphi(0)=0$ and $\varphi(x)\equiv (-1)^{p^s} \pmod p$ for integer $x$ not divisible by $p^s$.
Let $\mathcal A$ isbe union-generated by sets $A_1,\dots,A_m$ (we may even assume that these are all sets of our family $\mathcal A$), consider. Consider the following sum $$ \sum S(A_i)^{p-1}-\sum_{i<j} S(A_i\cup A_j)^{p-1}+\sum_{i<j<k}S(A_i\cup A_j\cup A_k)^{p-1}-\dots $$$$ \sum \varphi(S(A_i))-\sum_{i<j} \varphi(S(A_i\cup A_j))+\sum_{i<j<k}\varphi(S(A_i\cup A_j\cup A_k))-\dots $$ Modulo $p$ it equals $m-\binom{m}2+\binom{m}3-\dots=1$. On $$ (-1)^{p^s}\left(m-\binom{m}2+\binom{m}3-\dots\right)=(-1)^{p^s}. $$ On the other hand, expand this as a polynomial in variables $\nu(1),\nu(2),\dots,\nu(n)$. Consider eachThere is no free term, since $\varphi(0)=0$. Consider any specific term, say $X=\nu(1)^2 \nu(2)\nu(5)\nu(8)^{p-5}$$X=\nu(1)^3 \nu(2)\nu(5)\nu(8)^{p^s-6}$. Assume that elements 1,2,5,8 do not cover our family $\mathcal A$, that is, there exists index $t$ such that $\{1,2,5,8\}\cap A_t=\emptyset$. Then we may partition summands with the term $X$ onto pairs $\{\cup_{i\in I} A_i,\cup_{i\in I\cup\{t\}} A_i\}$, where $I$ runs over non-empty subsets of $[m]\setminus t$ such that $\{1,2,5,8\}\subset \cup_{i\in I} A_i$. For each such pair term $X$ cancels. So, total coefficient of $X$ is 0. But some coefficient is non-zero, thussince tital sum is not divisible by $p$. Thus there exists a cover of $\mathcal A$ of size at most $p-1$.
The same trick works for $p=4$ if we use the polynomial $x^3+x$ instead of $x^{p-1}$$\deg \varphi=p^s-1$.