From osascript’s man-page:
-i Interactive mode: osascript will prompt for one line at a time, and
print the result, if applicable, after each line. Any script
supplied as a command argument using -e or programfile will be
loaded, but not executed, before starting the interactive prompt.
This (or osascript’s support for stdin) should be possible to use to step through a script but I think you need a wrapper script that, typically, would read the source code from a file and feed it into osascript. Had anyone written such a script?
I am trying to use osascript in a shell based workflow, and it would be very useful to have this functionality (a wrapper script) in my workflow!