There are a couple of ways, ultimately.

Depending on the naming structure of your Terminal Servers, you can use INSTR or LEFT:

 Code:
if INSTR(@WKSTA,"Terminal") = 1
     ; do things

 Code:
if LEFT(@WKSTA,5) = "Termi"
     ; do things

INSTR will just look for the string - "Terminal Server 1" and "Bills Terminal Illness" will both return positives, and that may not be what you want.

LEFT will only return positive if the LEFT x characters match - "Terminal Server 1" would be positive, "Bills Terminal Illness" wouldn't.

You could also use the @TSSESSION macro to determine if it's a Terminal Services session:

 Code:
IF @TSSESSION = 1
     ; do things