If you put a breakpoint on the line where A calls B, and step into B, breakpoints you add to script B should now work.
Strangely, pasting all the code into one big file doesn’t always work either. I guess the debugger gets confused with large scripts.