I could not find a publicly available map service to test this with (i.e., one that supports dynamic layers but has one or more layers not visible by default), but manipulated the original sample to set some layers to mimic default visibility to off. See this JSBIN for the modified sample. Checking the layers on in this version does nothing. You can set the OVERRIDE var to false and it'll skip the modifications to run as original sample, in which the layers do turn on properly.
Am I missing something, or is there an issue with dynamic layers and layers not visible by default?