There are a number of way to hold onto data in a script project. The main places would be:
ScriptDB - a NoSQL DB that is specific to your script project. This in my prefered method for storing data associated with a script. ScriptDB Guide
Script and User Properties - Cross project properties that are specific to the script or to the user. Useful for storing information you as the script writer has no business knowing. See More...
You can also make connections to external SQL databases and there is a short-term caching service that can be used as well.