Like others have stated, I have washed my engine with water many many times. I often use some of the cans of "De-Gunk" or just spray "Simple Green" all over to help degrease. I've never had a problem, except once getting water under the distributor, which dried itself out within a day or clean it out myself.
Washing the motor does help, hoses and wires, even seals, will last longer if remove the gunk and corrosive chemicals that can build up and collect on those things. Of course there is always the risk the water can get somewhere it shouldn't and cause a short or problem.
If your not to wash your engine with water, then what do you use?
I suspect in this case, there is short deep in the wire harness or an electrical component you've gotten water deep into and it still hasn't dried out yet, causing your problem. In this case, I would NOT wash this engine again until you've corrected the problem that caused this and your confident it won't happen again.
Have you've tried running the motor long enough to get everything hot and evaporate any water out of everything?? I'm talking running the motor at full operating temp for a couple of hours.
I did pull the cap and it looked dry(there was some dirty water residue in there from a previous trip or maybe this one?) and the contacts on the cap had a pretty good amount of corrosion on them and the rotor, I cleaned the corrosion off, it started up and ran fine, thought it was fixed, but the next time I drove it, it acted this way again. I have never heard of wires/cap/rotor making one idle up like this.
I'm not liking the sound of this, it may NOT be the problem, but I don't think you can eliminate it as NOT being a cause. When a distributor cap/rotor has a good amount of corrosion I just replace them. Yes, I'm sure many people have cleaned them and they worked fine, but they are fairly precise device to carry the ignition voltage, the gap gets to big and you can cut down significantly on the ignition voltage. As well, the residue, on the cap, the ignition voltage is so high that stuff that normally doesn't conduct, can conduct the ignition voltage. I've read, but never had, that carbon/dirt on the ignition coil can short the ignition energy and cause problems, I wouldn't be surprised if some salty residue in the cap can do the same.
If you due for an ignition tune-up, and it sounds like you are, I'd do it now and see if that helps. It can't hurt, you'll have to replace that cap/rotor, ignition wires and plugs every 50-75k miles anyway (well, more often for the plugs). You may just be knocking it out early.
My wife, when she was my girlfriend had an old GM car that was stalling out and running very rough, mechanics, her family had tried everything, It was at 90k miles and saw engine paint on the spark plugs. Look over the igntion and it all looked like it had never been changed during the life of the vehicle. New Cap/Rotor/Ignition Wire and Spark Plugs and the motor ran like new. Ignition problems can cause the car to idle very rough and stall out.