doGroup is a mel script that does the grouping based on your ui settings. and if "zeroPivot" ( or world pivot ) . is set on the settings, it puts the pivot at world 0 0 0 using a second step using the xform command
group is the mel command that takes only certain flags.
to help you learn.. run the following to open the particular page that explains the mel command
help -doc group;
if you run :
whatIs doGroup
it will give you the path of the mel script that you were first running and you can open it in a text editor to see what it is actually doing.
and you can run
help group;
to get all the flags for the mel command
Synopsis: group [flags] [String...]
Flags:
-a -absolute
-em -empty
-n -name String
-p -parent String
-r -relative
-uag -useAsGroup String
-w -world
With no flags given, group will center the pivot of the objects grouped.
so I'm guessing that's what's happening in your scenario.
so basically, you want to add the xform command, to set your pivot to where you want it.
hope that makes sense and helps
-=s