function scriptPropertyWithDefault(key, defaultValue = undefined) {
  const scriptProperties = PropertiesService.getScriptProperties();
  const value = scriptProperties.getProperty(key);
  if (value) {
    return value;
  }
  return defaultValue;
}
Wraper around script properties to allow for a default value if unset.