I think it is legal. Case 4 doesn't have a break statement, meaning it will also execute the code for case 9. The original coder (I suppose you), wants this but wants to skip the first line of case 9. The if accomplishes just that.
If i%10 == 9, code execution jumps to the case 9 line directly skipping the if(0), meaning both lines are executed. It is clever, if you ask me.