For a generic approach of replacing your variables in JavaScript strings you could you the following snippet;
var tmp = '<script>' +
... +
'<\/script>'
.replace('${isActive}', isActive)
.replace('${isPassive}', isPassive)
.replace('${isGuest}', isGuest)
For a more detailed solution on your problem, we need information about the framework and template engine which you are using.
EDIT:
I noticed that the closing script tag causes an error. YOu might want to escape the closing script tag at the like so:
<\/script>