Hi ZeroZero,
welcome to the forum!
Do you have any particular task that you would want to solve using a script?
The best way to learn I think is to try to implement some idea yourself and ask questions when you need to. One area where I find the KSP documentation PDF is lacking is how to use loops. If you want to see some more examples of using while-loops you can check out the
Iterative execution section of my KSP tutorial. Maybe you could try to understand the code in that and the two following sections. Then you could try yourself to expand that arpeggiator script to let the script user choose between different scales and playing speeds.
Cheers,
Nils