Ok ... here is what I see as problems:
1. Each opening brace is interpreted prior to END, hence out of order printing of final statements
2. += construct should be treated as a normal math problem, ie what you have written is:
total = total + $3$4$5
As you can see this is not what you want
3. As average only needs to be calculated at the end it should be put in END section (not wrong just not needed previously)
4. I am curious that you receive no errors because as Tinkster points out, the lack of quotes around the tab entries errors for me
I think if you fix the above items you might get closer to what you want.