Currently the AI has no access to the backToWork order (it would need to transfer more simulation data to it). That's in general not a problem, except for trade: each time an order is given to the trader (either a garrison order when attacked, or a move order to avoid some enemies or whatever), it has to setup a new trade route and thus looses all its currently traded goods.
That patch catches that situation, and changes the new route to a backToWork order inside UnitAI.
Maybe a bit hacky, but the alternative would be to transfer to the AI all the backToWork orders and send messages when these orders change. I don't think it is worth as long as it is only needed for trade.