Basically you are correct.. CMOS cameras allow you to change the gain of the amplifier used in the camera. As you increase the gain you will increase the signal you get in the image but you will also increase the noise. So setting the gain is a balance between getting a good signal and minimising noise. For the Panasonic chip used in your camera I have found a Gain of 2 works well for LRGB images. Because narrow band filters darken the background you can use a higher Gain for narrow band filters.
Having assumed that then you need to optimise the exposure length. The aim here is to expose the image long enough that the image signal overwhelms the camera noise. For a gain of 2, with your sky conditions, you have found that an exposure of 20 secs is optimum. The camera adds 2 electrons of noise from the readout of the image so the exposure needs to be long enough to overwhelm that noise. However, I suspect the sky noise from the light pollution in your skies will dominate. Although 20 secs would be optimum, exposing for 40 secs would do no harm so I would use that. Such short exposures may allow you to do unguided exposures.
For darks, a set of 40 sec dark frames at a gain of 2 would be ideal. Unlike CCD cameras CMOS need darks of the same exposures as the lights but at 40 secs that should not be a chore. You observations on the dark frames are confusing because you have changed the gain and that increases the noise.
The reason Gain 1 is not used so much is that it can suffer from digitisation noise and to avoid hat people use a gain of 2. This gives a bonus in that the readout noise is reduced.
For dark frame combination I prefer median as it will reduce cosmic rays but averaging will work.
The teashirt over the i-pad works but may not give a totally uniform illumination across the whole screen. You could try sky flats where you put the teeshirt over the telescope objective and ‘look’ at an illuminated white screen or the sky. Or you could buy a flat frame accessory. Try the ipad first.
Hopefully that helps but the important things to do is try out these settings and then change them to see what impact they have. If you want to calculate the exact, ideal settings for your personal conditions then Sharpcap can measure them for you.The software costs £10 a year and it is a great help in using these cameras although there are many other packages out there and a few are free.