scriptContext is undefined in your current code as...
# suitescript
c
scriptContext is undefined in your current code as its not an entry point method so it has no idea what scriptContext is