Is statement not working

In the first case, use ScopeIf node instead. In the case of Code Block, I think the logic is exactly the same used by If node (see this).