Python command within script to abort without killing Blender
If it is meant to be temporary while drafting the script, raising an exception is probably the easiest solution.

raise Exception()


If it is not meant to be temporary you may consider reorganizing your code using additional functions or logic/control flow. Python actually runs faster if the code is wrapped in functions. (see this post on stackoverflow)

The equivalent to running the code from the text editor is (see api docs)

filename = "/full/path/to/myscript.py"
exec(compile(open(filename).read(), filename, 'exec'))


Calling sys.exit() raises an exception which is allowed to propagate and thus exits blender. (see
SystemExit, 
exit(),
exec()
)

You may run your script manually with exec and catch an exception, i.e. SystemExit, with try ... except.