$v1 already works in while loops. Even the exact code you posted produces the expected result.

Note that if you call an alias containing an if statement then $v1 and $v2 will be overwritten for subsequent commands.