calling a function is no different than copy and pasting those actions into the place where the function is called (except the function doesn't know what objects were picked when it was called). But the actions in the function can still only pick objects that were available to be picked at the point it was called, so it is really still part of the same top level event even though you divided it into two functions.
if you want the tiles to be fully created when you add the enemies, then the enemies must be created in a separate top level event.
so, if you don't want to do:
AJAX on complete - call function CreateLevel; wait 0; call function CreateEnemies;
then use a GameState variable:
AJAX on complete - Set GameState to "CreateLevel";
System GameState = "CreateLevel" - call function CreateLevel; Set GameState = "CreateEnemies"
System GameState = "CreateEnemies" - call function CreateEnemies; set GameState = "LevelReady"