maybe try this?
when thinking outside the screen program
1. start up screen with an expectation there's more to do when screen quits, like check a file with a result
screen && cat /tmp/exit_code # if your intent is exit screen normally, the use AND "&&"... otherise if your screen session is killed abnormally from some other terminal, you might need to use OR "||"
2. while inside screen, expect that the final line of your script will ALWAYS be storage mechanism for the previous command
cat /tmp/nosuchfile # last desired command in script (i'm intentionally getting an exit code code here other than zero)
echo $? > /tmp/exit_code # storing exit status of that last command, which is the final command in script
screen -X quit # exit screen either manually, or via script
3. Once screen exits you should see the exit status of that last desired command from script
-------------------
[screen is terminating]
1
--------------------
does that help you?