Personally (not that anyone asked) I have a script that will remove all stale fifos before starting ii, then wait for fifos to appear before writing commands to them (with an extra optional wait on the end). I also have ii exit(2) if it times out, and run each ii in a loop in the background so it will re-issue all those commands on a reconnect after a timeout. I'm not sure I did a good job explaining that, and I am sure the code is fairly ugly (there are some things I would clean up, but it works well enough for me), but if you're brave, go ahead and take a look.
https://bitbucket.org/emg/pcw/raw/13c87a010c67/extras/chat.sh -emg