Dynamo script returns null for all nodes

Solved broken script by restoring previous version.

Solved alternative “ScopeIf” node by making a Code Block based from this thread below:

Thanks