Passing multiple commands delayed to same process / PID

I would either use exec (in spawn mode) to call a complete bash script that did it all eg see https://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-scripts

Or try the node red node daemon which uses the inputort to accept msgs so you could send them suitably spaced.