I like to use script objects to store data:
set thePath to (path to desktop as text) & "myData.scpt"
script theData
property Counter : missing value
end script
try
set theData to load script file thePath
on error
-- On first run, set the initial value of the variable
set theData's Counter to 0
end try
--Increment the variable by 1
set theData's Counter to (theData's Counter) + 1
-- save your changes
store script theData in file thePath replacing yes
return theData's Counter