Will a variable retain its value for the entire execution of Process instance if its scope is set to "Instance"? Does this hold good even if the Process instance is stuck for a long time, or waiting on an Action Item, or if the session expires?
Any scoped variable is stored into BPM_CUSTOM_SCRIPT_PROPS table. That is how the system keeps consistent track of scope of that variable, so it does not expire.