Nice that you have that covered, and thanks for sharing your way there.
I just want to offer an additional thing to consider: different environments have a different byte-size for the return code (most common on COBOL for PC is 4, but 2 and 8 also exist).
Micro Focus COBOL and GnuCOBOL have a dialect option (effectively a compiler switch) to set the return code size *per compile-unit*. I'm not 100% sure if the one in libcobol is needed, but you likely want to consider increasing its _storage_ to 4 or 8 bytes; this way you don't have to cast on stop_run and can just assign as necessary.
Just my 5ct, Simon