%dist < 50 does not assign a value to %dist. It checks if the value of %dist is less than 50. Since %dist has no value at all, it will always be less than fifty.
You have to make %dist have a value. Simply listing it in the arguments of the function will not make Torque magically know you want the distance to go there. Actually, listing it there doesn't even help me understand what you want to go in that variable, and I am most decidedly more intelligent than Torque. Clearly dist is short for distance, but distance between what? I'm guessing you want the distance between you and the object you're shooting, but at the time of onFire nobody knows what that distance is. You can do a raycast and see how far ahead the object you're pointed at is, but if someone flies in front of the bullet the bullet won't travel that distance so it'll play the wrong sound. You can wait until the bullet hits something and then play the sound, but then the fire sound won't play until the bullet collides. Realistically there's no way to detect how far the bullet will travel until it actually hits something.