The script you linked is old and does not handle the fixed gender requirements of the starter Espeon and Umbreon (both of which must be male, and never shiny). Since Eevee is 87.5% male, statistically it'll be "right" more often than not, but it will produce inaccurate results frequently. It works for Eevee, simply because Eevee is not locked to a single gender (and can be shiny).
"locks" are a community term for requirements/disallowed features. In this scenario, a "gender lock" is when a Pokémon is only to be generated with a specific gender, and the game generating loop is locked in a repeating loop until it meets the criteria. When an NPC's team is generated, it usually has non-shadow Pokémon before the capturable shadow Pokémon. These non-shadow Pokémon have their own requirements, that cause the RNG to loop until satisfied, being nature and gender locks. In XD, the developers also disallowed shinies from being generated for the NPC (and the player), hence a "shiny lock".