Your BASIC knowledge seems to be in rust!
I have newer heard of this MAKEBIN, but I can help you with these BASIC things.
The BASIC memory starts from &H8000 or actually from address: peek(&HF676)+peek(&hF677)*256-1
I anyway refer it here just &H8000 as that is a typical situation.
&H8000 (byte) must be 0 to be able to run the program.
&H8001 (word) points to the address of next BASIC line. (next equal address as this is)
&H8003 (word) here is linenumber
&H8005 Here is tokenized BASIC line that is zero terminated.
You can restore the address in &H8001 by searching the next BASIC line start. That can be done for example like this: (NOTE: Do not add line number, that will mess up the memory area, we try to restore)
A=PEEK(&HF676)+PEEK(&HF677)*256:AD=A+3:FORI=0TO1:I=0:AD=AD+1:IFPEEK(AD)=0THENAD=AD+1:A1=INT(AD/256)

OKEA,AD-A1*256

OKEA+1,A1ELSENEXT
~NYYRIKKI