Here's another method that does work. This doesn't rely on any misinterpreted, undocumented data structures.
The idea is the same: Look for the program line that contains the entry point name. I thought the Substack list would give me a shortcut, but that didn't work out. In this macro, I look at every line of the program, starting with the line from which the macro was executed and working backwards toward the top of the program file. It's expected that the subroutine entry point (for example, O2001) will occur at the beginning of some program line which precedes the macro call.
I'll attach the macro text file so there shouldn't be any problem with mistyped punctuation.
This is the program I used for testing:
M98P2000
M30
O2000M9991
M98P2001
M99
O2001
M9991
M99