page.active is an integer value:
if (page.active == 1 || ...) {...}
Use page.active$ if you need to compare strings:
if (CompareNoCase(page.active$,"Sheet1") == 0 || ...) {...}
PS. If you need to run the script only for selected workbooks ("windows") it may be reasonable to check the condition within the corresponding loop to avoid unnecessary checks and to improve the readability of your code:
doc -ef W {
if ("%H"=="Book1" || ...) {
doc -e LW {...}
}
}