Basically this will work. However, GTM will only update its internal state when a GTM event is registered. When you you dataLayer.push({‘userType’: userState})
the new value for userType will not be automatically available. It needs to be followed by an event, either one that is set up via a GTM auto event variable (such as gtm.click when you use a click trigger), or a custom event:
dataLayer.push({
"userType": userState,
"event":"updateUserState"
});
(also note that you use backticks in your example, which will give an error - you must use straight or double quotes).
A custom event is literally the key "event" with a custom value pushed to the dataLayer. GTM overwrites the push method of the dataLayer array to scan new pushes for the event keyword, and then updates the available variables within GTM.