suggestion 1:
pick better scripts to learn from
suggestion 2:
open the mirc.ini file, you will see there is always the following format:
[SECTION]
item1=value
item2=value
To add to your ini file like that, simply use
/writeini filename.ini SECTION item value}
To read the value, simply use
$readini(filename.ini,SECTION,item