Yeah, you can't use anything besides a constant for loops, it's a limitation you have to deal with. The loops are unrolled when compiled, so it needs a well defined value.
Like Rojo said, the only way to make it work properly is to compile the shader at runtime with a different constant, but C2 doesn't allow that.
The trick you mentioned can work for convenience in some cases, but probably will impact performance at least in some hardwares.
If you only need a limited number of different values for the loop it's best to make multiple shaders with different preset constants. It's very inelegant and inconvenient, but it's what we have now.