change this
Code:
   writeini allcommands.ini commands $regml(1) $3-
to
Code:
   writeini allcommands.ini $chan $regml(1) $3-

changes [commands] to [#channel] in the .ini, so your !* command is
Code:
on $*:text:/^!(\S+)/:#:{ if ($readini(allcommands.ini,n,$chan,$regml(1))) msg # $v1 }