PrimalScript uses WScript or CScript to run a VBScript, so that is not really distinguishable from running it from a command window.

You can use WScript.Name to see what the host is.
If it returns "Windows Script Host" it is run from the command line or from within PrimalScript.
If it returns "SAPIEN Script Host" it runs in a packaged executable.
if it returns "PrimalScript Internal Script Host" it runs in the debugger.