You would be better off using a CMOS analog switch to multiplex the existing input.
CD4066BE is a good choice.
Or use a dual op-amp to mix the two signals, if this is acceptable, assumes one input is inactive.
The circuit in red is simply a resistive divider, an input protection/attenuator with small caps to attenuate/filter out unwanted higher than audio frequencies and avoid the possibility of a high voltage transient applied to the inputs would damage the chip this circuit is feeding.