The 32 group limit cannot be easily lifted, since it corresponds to a bitmask stored into a 32-bit data type and changing this to a 64-bit integer type (on supported platforms and with -DLAMMPS_SMALLBIG or -DLAMMPS_BIGBIG, but not -DLAMMPS_SMALLSMALL) would require changes to most files in the LAMMPS sources. This is one of the reasons why the “chunk” feature was introduced in LAMMPS as an alternate approach to partition subsets of atoms.
So if you would want to make a change to the source code, I would recommend implementing a compute chunk/chunk command instead of modifying the group support and compute group/group.
I seriously doubt that including kspace into the analysis would result in a significant improvement of the results. You require kspace for getting the correct trajectory because accurate treatment of long-range electrostatic interactions usually does have a significant impact on trajectories, but if you do analysis of this kind, the data you generate from the trajectory (force, energy) is going to be “noisy” anyway. When using rerun you do have an accurate trajectory, though, since you were simulating with kspace included, so even if you add a little more noise to the analysis data by using a cutoff coulomb you will still have the correct distribution of data (assuming that the noisiness due to the smaller number of data is following a normal distribution). However, the computational cost of adding kspace for all subsets can be substantial. This will be more significant the more groups/chunks you have as the cost will increase quadratically with the number of groups/chunks involved.