I did something similar for the corpse piece vendor. It uses pretty much exactly that method with the CHAR command. I combined that with a wiki article about sprite naming conventions and made a code that continuously spits out theoretically valid sprite names.
With the... I think it was SNAX command, you can check if your sprite really does exist.
EDIT: Oops, didn't realize the comment would appear on top. I thought it'd be appended to the answer. Sorryyy!
The CAOS command RAND var1 var2 can be used to pick a random number between var1 and var2.
There isn't a command to pick random letters though, so you would have to pick a random number and convert that number into a letter.
You could just pick a random number between 1 and 26 and then do something like:
Recently I learned more about the CHAR variable thanks to Amaikokonut’s blog post at Naturing :: Nurturing.
Char has two commands: one that returns an ASCII code of a character and one that sets a character in a string. The one setting a character is interesting because ASCII code is just a number, and numbers can be randomized with RAND, so...
To set a character, you have to use the ASCII code of that character. If you run the number that corresponds to the correct character through the CHAR command, you will get a string with that character.
Now all that’s left is to figure out the ASCII code of the characters you want to use. I quickly googled the ASCII table and I found that for the characters A to Z, the codes are 65 to 90. For the characters a to z, it's 97 to 122.
So if you want a character between a to z, the resulting code would be this: