I have found myself in a similar situation:
I need to perform an activity once, for instance, a procedurally generated sprite that would remain constant once generated. There are some functions I need to use that can only occur in a draw event, instead of the create event where I would normally conduct activities which need to occur once. Because of these restrictions, artificial or not, the procedure to be run once must appear in every draw event.
I understand that I can create a variable in the create event that can be tested in the draw event and set in the script I need to run once. However, if "undefined" truly meant not (yet) defined, then the script that must be called every time, but execute once can be self-contained, with initial code:
if !is_undefined( need_this_very_specific_operation) exit;
need_this_very_specific_operation =false;
A simple, elegant, self-contained solution, available when is_undefined() doesn't require the item being tested to have been already defined. To have to "define" something as "undefined" is mind twisting, and defeats the ability to keep a function self-contained.