Any good way to automatically enable an RS-485 transmitter in hardware?
If you're using an ordinary asynchronous (UART) protocol, with a start bit at the beginning of every byte, one simple method is to use a monostable multivibrator (even the dreaded 555) set to the duration of a byte plus the start bit and about half the stop bit, and use that to enable the transmit driver.
If the multivibrator is retriggerable, you need to allow up to one full byte time from the end of a transmission before anyone else can transmit, because the multivibrator may have been retriggered by the last data bit if it was a zero.
If not, then it should shut off in the middle of each stop bit, and then trigger again on the next start bit.
Well "good" is a vague term, but you did say "cheap"...
The simplest solution to this I've seen and tested myself is to use a PNP transistor and RC network. The following example is intended for 9600 baud, so a 22k resistor and 1n5 capacitor are used. These values would be modified for different baud rates.
This is by no means an elegant solution, but it's simple and can be build from the parts bin.
Here's the schematic:
simulate this circuit – Schematic created using CircuitLab
Your best bet would probably be to use a small microcontroller (probably with a UART, though software bit-banging might suffice) which takes a "data in" signal and generates both "data out" and "transmit enable". You should probably have an edge-triggered interrupt on the "data in" pin that asserts your "data out" signal even before a byte has been fully received, so that as soon as the complete byte is received you can start transmitting it (it's normally a good idea to assert transmit enable a little while before transmission actually begins). After a certain amount of time elapses without either a falling edge or a completely-received character, turn off the transmit enable pin.
The above approach would introduce a delay of a full character time between when the processor receives data and when it goes out the wire. In some cases, it may be desirable to reduce that time. Doing so would require using a software bit-bang UART instead of a hardware UART. Getting the timing correct at higher bit rates would be difficult, but one could have much finer control over the timing of the incoming and outgoing data.