some time ago I found the attached solution to unsecuring BASIC 2.0 programs for the 9826 (sorry I don#t remember the source).
Maybe you can rework it a bit so that it works with your programs.
The code is using the ReadIO() function with the -9826 parameter to access the program loaded in memory. This is documented in the BASIC manuals.
The tricky part seems to be more in the calculation of the locations of the line numbers.