You can take $\kappa(n) = n/2$ if $G$ is not virtually nilpotent of class $\le 2$.
Let $B_n = S^{\le n}$ and $C_n = \{[b_1, b_2] : b_1, b_2 \in B_n\}$. Suppose $|C_n| < n/2$. By pigeonhole there is some $m < n$ such that $C_m = C_{m+2}$. For $[b_1, b_2] \in C_m$ and $s \in S$ we have $[b_1,b_2]^s = [b_1^s, b_2^s] \in C_{m+2} = C_m$, so $C_m$ is a union of conjugacy classes. Since $G'$ is generated by the conjugates of $C_1 \subseteq C_m$, it follows that $G'$ is generated by $C_m$. The conjugation action of $G$ on $C_m$ has finite-index kernel $K = C_G(G')$, and $[K, G'] = 1$. In particular $K$ is nilpotent of class $\le 2$.