Explicitly check the $line variable in all conditions in parse_if_line

This avoids the hidden assumption that the parameter passed is
also available in $_.
Handle if conditions in .rept
Refactor handling of .set to a reusable function
Handle .set when expanding repetitions as well