It seems like there are two separate issues.
Undefined:
The spreadsheet reflects the value you provided in the SheetSet function. If that value was undefined (for example, if the variable you referenced does not exist), then you will see "undefined" in the spreadsheet.
Not working:
Could it be because you are out of credits? You can check your current usage on the
Usage Statistics page and select a different plan if needed.