The "sleep" command is controversial. It can be used to automate gameplay and I would suggest not using it at all. Whether it is considered automation for the purpose of formations I couldn't say but personally I wouldn't take the risk.

Your problem with the "staggering" is probably related to sending keypresses instead of key up and key down combinations. If you use F12 as a formation key, for instance, I suspect that you are sending the key onto the clones as "{F12 down}{F12 up}". You need to send the up and down messages separately. If you use the ClonesPush procedure:

Code:
~F12::ClonesPush("{F12 down}")
~F12 Up::ClonesPush("{F12 up}")
Also see the Movement section in the wiki.