Perko switches are Make Before Break, so switching whilst charging is no problem: Perko Dual Battery Switch
in terms of battery management, what I'd recommend is to nominate one battery as your primary, and start the engine on that battery. Use this battery for everything - nav lights, the lot, until it goes flat. Always charge it first until the amps drop off to zero, and then switch over to top up the secondary, and you'll always have power for starting your donk.
As a backup measure, I like to have the ability to hand-crank the engine to start it, and use a camping gas or paraffin lantern at night if light is required for prolonged periods.
Clearly these methods aren't necessary on modern boats with gennies