Learn the basics first, via a tutorial or something, make sure you know what variables, functions, scope and callbacks are, and how to use them. Make sure you know how to do if statements and loops too. Maybe make a small map with the purpose of just testing the script with these basics in.
With the basics out the way, it is time to teach yourself
. Find what goal you want to achieve (I.e: Design a level) and then work out what you need to know, research and have a go at reaching that goal. It probably won't work first time so try working out why yourself, and if you get stuck then post a topic on these forums asking for a
little help (You won't learn as much if other people solve all the problems for you).
Also have a look at the existing scripts for the game, if only to look at how the scripts are set out - indentation and comments may seem purely a aesthetic exercise, but they greatly help out other people when the time comes for you to ask about something (and you, when you come back to your code months later to look at how you did something).