You could consider to use ssh connection sharing:
You connect only once to your destination, and put the ssh process in background. Then you execute the other commands and you finally kill the first process.
In alternative you can try to encapsulate a bunch of actions within one single ssh connection.
For example, imagine that you have a directory:
Then you can pack this data in a tar and send it to your script:
tar cf - -C mycommands . | ssh localhost 'D=`mktemp -d`; tar xf - -C $D; $D/run'
run script can access to all your input data (here we have only the
new_data as in your example). To stick with your example, here's the
mv $BASE/new_data /var/some_service/new_data
rm -rf $BASE
So, now you just have to save the
tar cf - -C mycommands . | ssh localhost 'D=`mktemp -d`; tar xf - -C $D; $D/run' >./events
and more generally you can have your
run script produce a tar and then pipe
ssh into tar to unpack it locally.