The command you have only works coincidentally; You're setting the value of a variable named "cmd", because VoiceAttack strips the curly braces automatically (as they're not part of a valid token nor preceded by the "|" character).
If you want to pass the value of a token or a literal text value (which are the same thing in this context; Tokens are parsed and replaced with literal text) to tokens that support variable names and literal values, you need to wrap the value in double quotes (for text values, however not for numeric values; Check the documentation if you're unsure):
Say, 'depth set to {TXTNUM:"{CMD}"}'
To "pick apart" the number, you can use the "{TXTSUBSTR:}" token:
Set Text [depth] to '{TXTNUM:"{CMD}"}'
Start Loop : Repeat From 0 to [{EXP: {TXTLEN:depth} - 1}]
Play sound, '{VA_SOUNDS}\{TXTSUBSTR:depth:~i:1}.wav'
End Loop
You could use "{CMD}" directly here as well, but I'm assuming you're storing the depth value for later use.
The loop is a "Loop Start - Repeat a Certain Number of Times" action, with the "Range (For Loop)" option selected, and "Indexer Name" set to "~i".
For the meaning of the tilde character, have a look at the "Advanced Variable Control (Scope)" section of the manual.