Update scripts/view.py

Improved balanced parentheses check: see issue #10