The best you can do is using IMAP cache, as you do.
You can then `disconnect' / `connect' as you will, and it usually
"pampers over" the problem.
Other than that setting "set imap-keepalive=X" to install an alarm
based trigger every X seconds often helps, too.
Maybe 300 or even 120 for super picky wifi i have seen (if it
helps at all).
But why does the imap disconnection interfere with reading the temp file
saved by the external editor? S-nail hasn't crashed. It is still
running and able to respond to commands.
Stephen Isard