Most people tend to avoid sound questions on this site for some reason. I don't, because I'm a sound guy myself.
However, I don't know the answer because I haven't studied arrays yet. It's on my to-do list.
For functions, you can always put sound event in a function. However, for random sounds, check out these search results...