It seems you imagin that there is a simple, straight-forward “mapping” rule between the source code lines in the Manual mode and the lines in the Script mode.
No, that is not the case.
The system is far more complexed. See the following post of mine:
The keyword is “Abstract Syntax Tree Transformation”. See the following article for what AST Transformation is, which was written 15 years ago by Guillaume LaForge, the Groovy language mainterner: