That's fine until the actual group name gets longer than the spaces allow for.
If you can't figure out best way of using screen co-ordinates (or however it currently spaces them), then at least practice/teach your self string.len, .find and .gsub
Could probably use something like
PSUEDO CODE...this is mostly for the idea logic
if string.len(to.string<group variable>) < <number of widest space you'd want> then --is column shorter than widest allowable?
string.gsub or for loop to add spaces to end up to <number of widest space column you'd want> -- do something to fill in the space/widen it dynamically
else -- groupname is wider than you want
cut it short in some way (gsub with ... at end 3/4 through group name?) -- use code to "shorten" the group name in the display (... is often used)
end -- check done