The checkbox on the left enables or disabled the parameter while the one on the right enables or disables the value of the parameter. So:
left checkbox off: value = default
left checkbox on:
right checkbox off: value = false
right checkbox on: value = true
This is somewhat confusing, but it falls out of the general layout that all rows have, since all rows can be disabled/enabled with the checkbox on the left.
Yes, if the left checkbox is disabled, the parameter is not reported by the Glyphs API for the font/master/instance and thus nil is returned (your first check in the if test).
Oh, it seems the check against nil is not necessary, strictly speaking, as linkMetricsWithFirstMaster.integerValue would return 0. I guess I’ll keep this code anyway as it is more readable.