This one is going to sound like I've been suffering from sleep deprivation for way too long, but I tested it several times in single-step mode. It was consistent in this particular subroutine, but not across all subroutines.
This is under KSS 8.3.14.
If I had the following code:
I directly observed, repeatedly, in single-step mode, that the program pointer would enter the IF statement (bReturnFromSub was confirmed True), then single-step into the RETURN statement, and then continue on through the ENDIF and keep going down through the rest of the subroutine.
According to a colleague of mine who has observed the same phenomenon, this occurs only:
1. In subroutines, not functions (in other words, returning a value doesn't seem to have this issue)
2. Inside an IF/THEN -- SWITCHes don't have this issue
3. In an IF/THEN with no ELSE -- adding an ELSE case to the IF/THEN appears to immunize this problem. Adding an ELSE definitely fixed it in the case of the subroutine I was testing.
I had a lot of IF THEN RETURN ENDIF setups in my code, but only saw this issue pop up on one of them. So it's definitely not a high-probability issue. Still, once I became aware of it, I made certain to add ELSE conditions to every vulnerable code block, just in case.