Can a Google Apps Script determine its own resource id? If it could, then it could discover what folders it is in (parents).
If it is only in one folder, then it could use that folder as a default folder for various purposes.
If it is in multiple folders, then the resource id is insufficient to truly identify where the script was started from, so the corollary question is can a Google apps script determine the resource id of the folder it was launched from?
Seems like these would be useful additions, maybe to Class Session, if it doesn't already exist somewhere that I have missed.
For a Spreadsheet I found this to work:
var thisFileId = SpreadsheetApp.getActive().getId();
var thisFile = DocsList.getFileById(thisfileId);
As per my knowledge, there is no option in Google Apps Script to get its own resource ID. You should file a feature request in Google Apps Script Issue tracker.