I would use the SetINIFileData for that.
The next function will create a file if not existing, and set the value of choice one higher.
Code:
// call function
addToLog('test');
// Function counts 1 to logfile value
function addToLog(key)
{
logFile = 'C:\\test.log'
logSection = 'LOG'
curValue = GetINIFileData(logFile, logSection, key)
newValue = String.integer(curValue) + 1
succes = SetINIFileData(logFile, logSection, key,newValue)
if( !succes) Debug.trace('addToLog() :: Set log value not succesful for key '+key)
else Debug.trace('addToLog() :: new value = '+newValue)
}