Yes, you are absolutely correct to use the offline_access scope. This will give you also a Refresh Token back, which you can then use to acquire a new Access Token with the same scopes as the previous, expired one.
However, you don’t need to periodically need to run the refreshToken method but only in case when you get an error back from the resource server you’re calling due to an expired access token. In this case, renew the access token, call the backend again with the renewed one.