Why bother with that?
Just use the built-in RANDOM variable, as OP has done.
Note: Yours might be technically superior - perhaps it gives "better" random numbers - but I doubt it would be worth the trouble for the OP (or anyone else) to go through the bother of debugging it to make it suitable for their own use.
BTW, wasn't there another thread on this same topic some time ago? I remember giving an answer to the same question (the names kat1, kat2, etc rang a bell with me).
Edit: Oh, yeah. This thead is similar - but different:
viewtopic.php?f=34&t=293021&p=1770827&h ... 1#p1770827
Edit 2: You can use the bash "let" statement to make dealing with arithmetic a little easier.
$ let 'choice = 1 + RANDOM % 6'
The quotes are necessary, but beyond that, a lot of the extra syntax involved in doing it without "let" goes away.