I pretty much agree with @scott-sumner 's comments on this. It may not be a great design, though. I would much rather have the Replace box contents follow the Find box contents, when the Replace dialog is invoked. Most times I need to replace with something very similar to what is already there–for example, in coding, maybe I am making a variable name slightly more descriptive–I want to keep the bulk of what is there already but make a slight change. Having the original already in the Replace box for tweaking would be ideal. Also, this would solve your problem, I think. If the Find box is the same as the Replace box, “accidentally” doing a replace would change nothing.
Perhaps you meant to press the Close button, which is right next to the Replace All in Open Docs button…hmmm…I can see this happening. You could switch to using the <ESC> keypress to close the dialog box. Or, of course, press the X button in the title bar of the window, although that is small. Because there are these 2 other options for dismissing the dialog, maybe the best option would be for the Close button to be eliminated entirely. That way, no accidental press of the adjacent button, and the dialog box would be less cluttered.