Why must you run it with bash if it was made to work in sh? Is it that it won't work on a machine that uses bash as sh? I'd almost want to completely rewrite something like this before feeding it to bash. The amount of evil (i mean eval) used in there, and using cat file | head | tail to grab each line rather than a while read loop... wow.
no one is going to want to maintain something like this.. delete it!
There are 375 "integer expression expected" errors in your sample bash log with 51 different variations.
That error message usually comes from the expr command but the log suggests that it is coming from if statements.
The script is virtually impossible to follow due to the use of eval commands, and made even more complicated by the use of functions (which may well behave differently in bash).
Short of a total rewrite, all I can suggest is testing line-by-line until the bad construct (or constructs) come to light.