Thanks for the code but, unfortunately, I can't understand its exact "meaning". Line 1 forms an array. Line 2 assigns some value to _muzzleName and Line 3 has the player select the weapon determined in Line 2. That's all I got. But I will throw it up in the editor and can probably "back into" its meaning. Thanks.
_muzzles = getArray(configFile >> "CfgWeapons" >> (primaryWeapon player) >> "muzzles");
Creates an array of the muzzles of the player's primary weapon (from the CfgWeapons file). i.e. if you have a gun with a GL, this will have both muzzle names.
_muzzleName = if (count _muzzles > 1) then { _muzzles select 0 } else { primaryWeapon player };
Counts the muzzles. If there is more than one, then we select the first one (index 0), otherwise we get the primary weapon (if it only has one muzzle, it's weapon name is the same as the muzzle name). Selecting the first muzzle means that it'll select the gun itself above the attached GL (provided all the configs for the weapons are set up properly... which they are

).
player selectWeapon _muzzleName;
Selects the correct weapon that we've discovered by the line above, for the player.
As for 'muzzle', according to Wikipedia:
The muzzle of a firearm is the end of the barrel from which the projectile will exit.
In ArmA terms, this is basically just the number of barrels the current weapon has. Usually this is just the main gun and the GL, as you said.