You can write Select statement on table that stores information if printer is locked or search and use any FM which returns this information( you can also debug the RSPO_CHECK_DESTINATION to see how it determines that device is locked and use same logic) and call this before calling"RSPO_OUTPUT_SPOOL_REQUEST". In case device is locked, don't call this FM and append your error table, otherwise call the FM.
Regards