Cyclomatic complexity script
bash grammar is notoriously hard to parse. Your script is easily misled by many valid bash constructs.

For example, it unconditionally consider # as a comment, whereas it could be escaped, or a part of a special parameter $#, or a part of ${parameter#word} expansion.

It will consider the assignment (stupid but valid)

    x=\;;


as an end of case. It will miss a loop in

    cat file | while read line


It will count the contents of a 

    &lt;&lt;EOF
    while
    for
    until
    EOF


as loops.

It incorrectly handles nested case statements.
awk is a powerful programming language. If you feel you need to invoke it, consider using it for an entire script. It is particularly inefficient to invoke awk for a single line of input.
bash is also a very powerful programming language. The constructs like

    temp=`echo $line | cut -d ' ' -f1`


can be more clearly (and more efficiently) expressed in bash, e.g.

    read temp rest &lt;&lt;&lt; $line

Testing for the presence of # to remove the comment is redundant. The expansion works correctly even if it is not there (in which case the line remains unchanged).