I'm probably doing something stupidly wrong here, but I can't seem to find it.
I created 3 PHP scriptlets that replace a moustache string with a date.
[{"name":"Next SFD","description":"Replace {NEXTSFD} by the date of the next SFD","category":"DATES","search":"{NEXTSFD}","replace":"<?php\r\n$year = date('Y');\r\n$sfd = new DateTime(\"third saturday of september $year\");\r\n\r\n \/\/ If the date has already passed in the current year, get the date for the next year\r\n if ($sfd < new DateTime()) {\r\n $year += 1;\r\n $sfd = new DateTime(\"third saturday of september $year\");\r\n }\r\n\r\n echo $sfd->format('l, F jS Y');\r\n?>","area":"body","params":"{\"xml\":\"\",\"use_xml\":\"0\",\"regex\":\"0\",\"treat_as_list\":\"0\",\"word_search\":\"0\",\"s_modifier\":\"1\",\"casesensitive\":\"0\",\"max_replacements\":\"\",\"thorough\":\"0\",\"strip_p_tags\":\"0\",\"treat_as_php\":\"1\",\"enable_in_category\":\"1\",\"enable_in_title\":\"1\",\"enable_in_author\":\"1\",\"enable_in_feeds\":\"1\",\"enable_in_admin\":\"0\",\"enable_in_edit_forms\":\"0\",\"between_start\":\"\",\"between_end\":\"\",\"enable_tags\":\"1\",\"limit_tagselect\":\"0\",\"tagselect\":\"*[title,alt]_meta[content]\",\"has_conditions\":\"0\",\"condition_id\":\"\",\"condition_alias\":\"\",\"condition_name\":\"\",\"other_doreplace\":\"0\",\"other_replace\":\"\"}","published":1,"ordering":0},{"name":"Next HFD","description":"Replace {NEXTHFD} by the date of the next HFD","category":"DATES","search":"{NEXTHFD}","replace":"<?php\r\n$year = date('Y');\r\n$hfd = new DateTime(\"third saturday of april $year\");\r\n\r\n\/\/ If the date has already passed in the current year, get the date for the next year\r\n\r\nif ($hfd < new DateTime()) {\r\n $year += 1;\r\n $hfd = new DateTime(\"third saturday of april $year\");\r\n }\r\necho $hfd->format('l, F jS Y');\r\n?>","area":"body","params":"{\"xml\":\"\",\"use_xml\":\"0\",\"regex\":\"0\",\"treat_as_list\":\"0\",\"word_search\":\"1\",\"s_modifier\":\"1\",\"casesensitive\":\"0\",\"max_replacements\":\"\",\"thorough\":\"0\",\"strip_p_tags\":\"0\",\"treat_as_php\":\"1\",\"enable_in_category\":\"1\",\"enable_in_title\":\"1\",\"enable_in_author\":\"1\",\"enable_in_feeds\":\"1\",\"enable_in_admin\":\"0\",\"enable_in_edit_forms\":\"0\",\"between_start\":\"\",\"between_end\":\"\",\"enable_tags\":\"1\",\"limit_tagselect\":\"0\",\"tagselect\":\"*[title,alt]_meta[content]\",\"has_conditions\":\"0\",\"condition_id\":\"\",\"condition_alias\":\"\",\"condition_name\":\"\",\"other_doreplace\":\"0\",\"other_replace\":\"\"}","published":1,"ordering":0},{"name":"Next DFD","description":"Replace {NEXTDFD} by the date of the next DFD","category":"DATES","search":"{NEXTDFD}","replace":"<?php\r\n$year = date('Y');\r\n$dfd = new DateTime(\"last wednesday of march $year\");\r\n\r\n \/\/ If the date has already passed in the current year, get the date for the next year\r\n if ($hfd < new DateTime()) {\r\n $year += 1;\r\n $hfd = new DateTime(\"last wednesday of march $year\");\r\n }\r\n\r\n echo $hfd->format('l, F jS Y');\r\n?>","area":"body","params":"{\"xml\":\"\",\"use_xml\":\"0\",\"regex\":\"0\",\"treat_as_list\":\"0\",\"word_search\":\"0\",\"s_modifier\":\"1\",\"casesensitive\":\"0\",\"max_replacements\":\"\",\"thorough\":\"0\",\"strip_p_tags\":\"0\",\"treat_as_php\":\"1\",\"enable_in_category\":\"1\",\"enable_in_title\":\"1\",\"enable_in_author\":\"1\",\"enable_in_feeds\":\"1\",\"enable_in_admin\":\"0\",\"enable_in_edit_forms\":\"0\",\"between_start\":\"\",\"between_end\":\"\",\"enable_tags\":\"1\",\"limit_tagselect\":\"0\",\"tagselect\":\"*[title,alt]_meta[content]\",\"has_conditions\":\"0\",\"condition_id\":\"\",\"condition_alias\":\"\",\"condition_name\":\"\",\"other_doreplace\":\"0\",\"other_replace\":\"\"}","published":1,"ordering":0}]