telnet and run scripts

Hello folks,
I've got this script which connects to different boxes and executes a certain script in those locations. The following is the line from where i am trying to do this:
(sleep 1; echo $USERID ; sleep 1; echo $PASSWD ; sleep 1 ; echo y ; sleep 1 ; echo "\r" ; sleep 1 ; echo "cd $FILEPATH" ; sleep 1 ; sleep 1 ; echo "./MessageCount.sh $BOXNAME $PATHNAME $FILENAME |&" ; sleep 80)| telnet $SERVER
Do i actually need to give the 80 seconds sleep time since it is running in the background?
The other (real) problem that i am facing is that the connection to the boxes are getting closed even before the scripts have finished running.
Thanks a lot.

See:
changepass automate password changes on multiple systems
as an example of my approach to this.