You can't pit %t statements inside a conditional. %t statements are used to define entire alternating subLINES, meaning that when you read the end of one (the semicolon) everything after is treated as a new line. Thus, your conditional isn't being closed.
You'll need to use multiple duplicate conditionals, an identical one on each subline.