You have floating code at the top. The first 3 lines don't belong.
You need to work on your general syntax. Spaces are missing between inc and %variable, or around $+'s, etc.
I recommend you practice writing Aliases before you start writing Event driven scripts. Get your syntax down with aliases you can type and get a predicted behavior nailed down.