This is a bit on the simplistic side, but the netcat program with mTCP can be used for tasks like this.
Create a batch file that runs netcat, and pipe the output from netcat to a temporary batch file. The next line of the batch file after netcat then executes the temporary batch file. After that you can use netcat again to send the results back, and then loop to the top to start the cycle again.
All of this assumes that the commands you are running are well behaved and use stdin and stdout correctly.
Netcat could also be modified to accept input and then make an exec call to execute what you just sent it. Or even build a little command parser into netcat so that you can do more sophisticated things. Modifying netcat shouldn't be too bad; learning how to build it would be the most difficult part.
"Tiny" from Josh (linked above) is known to work well, and is a bit more robust in that it scrapes the screen.