I don't think you understand
this line of code
strpos($accentsAllowed[$hat[%cl.hat]],strlwr($accent[%cl.accent])) != -1
this is checking the position of a string within a string, if the string $accent[%cl.accent] does not exist within $accentsAllowed[$hat[%cl.hat]] then it will return -1 setting it to > 0 would cause the opposite effect to happen and if the unless the string appeared at position 0, which it will not because all $accentAllowed variables start with "none" which won't be checked anyway since the added check is imposed in
this is what was causing the console error because I hadn't realized that all the accentsAllowed also included the "none" word which caused it to attempt to unhide that node
the added checks for %cl.hat %cl.pack etc were unnecessary