Q:

Script is re-reading arguments

When I supply the script with the argument: hi[123].txt it will do exactly what I want.
But if I specify the wildcard character ( hi*.txt ) it will be re-reading some files.
I was wondering how to modify this script to fix that silly problem:
#!/bin/sh

count="0"
total="0"
FILE="$1"  #FILE specification is now $1 Specification..

for FILE in $@
do
  #if the file is not readable then say so
     if [ ! -r $FILE ];
         then
         echo "File: $FILE not readable"
     exit 0
     fi

# Start processing readable files
  while read line
          do

             if [[ "$line" =~ ^Total ]];
                 then
                   tmp=$(echo $line | cut -d':' -f2)

                   total=$(expr $total + $tmp)

                   echo "$FILE (s) have a total of:$tmp "
                   count=$(expr $count + 1)

             fi

        done < $FILE
done
echo " Total is: $total"
echo " Number of files read is:$count"

A:

On error, exit with a non-zero status.  Also on error, report errors to standard error, not standard output - though that may be a bit advanced for you as yet.
echo "$0: file $FILE not readable" 1>&2

The 1 is theoretically unnecessary (though I remember problems with a shell implementation on Windows if it was omitted).  Echoing the script name '$0' at the start of the error message is a good idea too - it makes error tracking easier later when your script is used in other contexts.
I believe this Perl one-liner does the job you are after.
perl -na -F: -e '$sum += $F[1] if m/^Total:/; END { print $sum; }' "$@"

I understand that you are learning shell programming, but one of the important things with shell programming is knowing which programs to use.

