That is a reasonable way to solve the problem with accidental collisions.
Another common method is to use an open drain output. It is the method
used by I2C to ensure that two colliding drivers will not draw too much current, and to ensure that the signal will either be low or high, and not something in between.
This way you can connect as many outputs as you wish, because they either do nothing, or pull the output to ground. If two or more pins drive the same signal to ground, nothing bad happens.
To make this work, you need a single pull-up resistor on the bus, and since no one is actively driving the signal high, this makes for a lower maximum bit rate.
Since you are using a software-driven serial interface, it should be easy to adapt to your needs. Instead of setting up the ports as push-pull outputs and then setting them as either low or high, you set them up as inputs with pull-up when they are supposed to be output high or input, and set them up as output low when they are supposed to be output low.