I bet we could crowd source the design of a Y vent fitting with a movable vane that automatically blocks the line not in use.
Then as long as you are not running the GF and the dryer at the same time it should be safe.
I would still be a bit concerned about combustion products from a gas dryer leaking back into the GF, but an electric dryer should be OK.
I was thinking of an arduino controlling a servo that switches the damper when the GF exhaust fan kicks on. you could do non-contact voltage sensing for the power going to the GF blower motor that would be a low voltage signal for the arduino to pick up and activate the servo to change the damper. should be about $35 and a Saturday.