If you want ghostscript error messages reported, remove the -q switch. Then, however, you always get a message from the print system containing the ghostscript banner. If you want ghostscript error output, change the stdout redirect from file descriptor 3 to file descriptor 5. The script that works for me is here. This step is standard and documented in the System Administrator Guide AnswerBook.
Users claim about print jobs hanging in the queue until they are canceled.
Have a look at it. They are not available for plain text files. Seems to be somehow cleaner than my solution. I've tested it successfully with a color deskjet printer.