RS485-RS232 through code

I realize I may have been unclear about the purpose of this code. My computer has a software that can configure the motor controllers through RS485, but the computer has no RS485 port. As an alternative, there was once a cable with an adapter that permitted connecting it to the RS232 port of the computer instead. I wish only to emulate this adapter, since it has gone missing.

I do not wish the microcontroller to say anything on it's own. That is why I am suggesting "bit banging" the communication straight to and from two arbitary pins connected to the RS485 of the motor controller, to the Rx and Tx pins on the arduino. Not because I want to talk to the arduino, but because the same pins are connected to the RS232-USB adapter (ATmega16U2).

The way I figure, the only tricky part is to know when to change data direction, since it does need two way communication in half duplex.