You can have an alias which does the writing to the .ini, and you can pass "CrossBow" as the $1 parm, and "iw8_sn_crossbow" as the $2.
If you have a place where all the weapons are stored, you can loop through that list to fetch the pair of parameters to be passed to the alias.

If the list of weapons is short enough to fit in 1 big long line, you could loop through that until the list is empty, passing 1 pair at a time.

Code
tokenize 32 weapon1 weapon1api weapon2 weapon1api etc

while ($1 != $null) {
aliasname_that_does_the_ini_write $1 $2 %stats %statsfiles
tokenize 32 $3-
}


note there's a -n switch for writeini related to .ini files larger than 64k, and it looks like you're writing a lot of data to it.