For long running operations such as replicate error are generated due to the result taking loger that most browsers feel are acceptable. Instead of hacking the browser around this it would be better that the result is a polling result. This would allow the client to poll for the operations completion without causing timeout messages.
As I see it:
Command in couch would have to return a new code and message, immediately, perhaps a session/task id.
The JS interface would need to be modified to poll for results and likely do a callback when complete.