If you look at the GoldYoink script in the help file (under "Scripting Documentation" -> "GoldYoink Project Source Code") the lines are numbered, and you'll be able to follow this relatively easily:
1) Lines 378 to 380 loop through all the templates in the initial map and copy all the sprite templates to the current map (the oMap that was passed in the parameter to the function). No maps besides the initial map contain any functions, sprites, templates or paths, just tiles.
2) Lines 382 through 384 loop through all the templates copied to the map looking for the template that represents the enemy sprite template (so it will be easier to assign the enemy sprites to use it later). To find it, it looks for any template with the word "Enemy" in the name.
3) Lines 393 and 394 begin a loop to examine every tile on the main (only) layer of the map.
4) Line 400 determines if a tile is one of the tiles that represents a picture of an enemy
5) Lines 401 through 414 replace the enemy tile with a sprite referencing the enemy template, using a new path at the tile's location. Initial instance is turned on for each enemy sprite with FLAG_INSTANCE.
6) Line 543 is where InitMap was called from
7) A little farther down you'll see in line 569 in that same function, an "InitEnemies" function is called to initialize some more details of the enemy sprite template after it is copied. Additional initialization is required only because the enemy sprites are implemented as a proprietary sprite type not supported by GameDev. They have ladder climbing states and falling states all in the same sprite. The enemy sprite template build into GameDev only defines the enemy as a left/right sprite, but the script adds a number of additional states after copying this template. The player sprite operates a little differently and did not need this kind of logic. The player sprite actually switches sprite templates when changing modes instead of just switching states.
8) In lines 575 through 588 the InitEnemies function locates the enemy sprite template information
9) In line 587 and 588, it sets it as a proprietary sprite type -- one not used by GameDev, and tells GameDev that this proprietary type has 7 states.
10) In lines 597 through 603, it clears out all the existing state information (the frames that were in the dummy left/right template)
11) In lines 605 through 611, it makes each state reference the same tileset that was referenced by the original 2 states.
12) In lines 613 and 625, it adds the images to the animations of the various states