Hardwiring Midi Thru to Midi Out?

Hi everyone,

For my midi controller, I am currently using a "soft" midi thru where the microcontroller accepts midi input and then re-transmits it out to midi out. I realized that this is not feasible for midi signals such as midi clock as there will be a small time lag. How do i hardwire the midi in to midi out so that all incoming signals are transmitted directly, and yet still have the midi in to the rX pin?

My circuit is similar to this:

Is it possible to attach a 220r resister from the microcontroller serial input and connect it to the midi out?

The problem with this sort of arrangement is how do you know that any MIDI message you send on the output is not going to get squashed by a thru message sent at the same time or during the time it takes to send a message.