I see this question is old but this addresses the problem in a clean way too without the need to use the -l flag although the -l flag exist for that exact same reason:
sqlplus test/Test@mydatabase @script.sql | grep -q 'ERROR' && echo "ERROR CONNECTING" || echo "SUCCESS"