The PIC18F452 has one UART, so it will only support one MIDI IN unless you have a little help.
There is a “IIC” or “I2C” MIDI module that can add another input, or there is a MBNet offering (very recently) that will allow you to network modules together over a CAN bus. This would require a processor change.
I’m no expert, but I think those are your options at this time. I’m sure if I got something wrong, then smarter people will correct me.
I think the problem would be if you switched while either one of the signals was in the middle of a message. That would corrupt the message and possibly confuse the UART.
It would also require more parts, as there is no way I know of to switch the UART inputs in software.
_But_, don’t let me discourage you. If you are sure that’s what you want to do, Enjoy the challenge!
The MIDImerger project is a very timing sensitive project where the second MIDI In is realised as a software UART. It is not possible to use the same approach if the CPU is loaded with other tasks, so it is especially not possible to use the same approach with MIOS.
Solution 1 is not possible, as MIDI lines are current loops
Solution 3: just use two optocouplers, and join the signals with a digital multiplexer. Maybe transmission gates (4066) could also be used.