For example, I have defined my levels and items organizing them by the level and Pokémon's Pokédex ID. For example, Level 10 comes before Level 30, so I'll check for Level 10 before. By what I want to do in my game, the only Pokémon that uses Level+Item and evolves at Level 10 is Wurmple. My hack will check for Silver Powder, if it is to become a Beautifly or Poison Barb, for it to become a Dustox. As Beautifly comes first in the Pokédex, my game will check first Level 10 + Silver Powder (that's argument 1) and then Level 10 + Poison Brab (argument 2).
Ok, next, Level 12. Only Pokémon that evolves at Level 12 is Tyrogue. The order is Hitmonlee, Hitmonchan and Hitmontop. So I've created 3 belts (beige, red and blue, corresponding to each Pokémon's color) and the routine checks Level 12 + Beige Belt for Hitmonlee (argument 3), Level 12 + Red Belt for Hitmonchan (argument 4), Level 12 + Blue Belt for Hitmontop (argument 5).
And so on.