A quick & easy trick would be to read the state (value) of your parallel port at the very beginning of your test, and to restore to that value after you are done.
There is a control bit which has to be set or reset in order for the printer to take control / communicate with the port. If it is set to the wrong value (I cannot remember if it is a "1" or "0"), then the printer will remain in standby mode.
If my memory serves me right, it also depends on the LPT port settings within the BIOS. I think I posted a link to some documentation on port values for the parallel port. I will do a quick search and post it if I find it.
JLV