Since your code runs on every page call, your second solution would be much simpler to implement. You can utilize the built-in extension parameters to store an extension-specific value.
First, take a look here: https://stackoverflow.com/a/13221472/1867759
This solution would work perfectly for you. The only difference would be that, since you're already within your plugin, you can access the parameters via $this->params
rather than calling them from JComponentHelper
.
Hope this helps!