First off, if you're going to use ($1 == #) on your line 2 to verify that the sub is coming from the channel that you want, make sure that you're specifying the full #channelname with the # symbol. I prefer to match the room-id instead to make sure that it's from the right channel, this makes more sense to me as the room-id can never change but the name of the channel on Twitch can change if you change your username.

Example:
Code:
if (($msgtags(msg-id).key == sub) && ($msgtags(room-id).key == 83931881)) {


You of course would replace the number of the room-id with your own room-id number. You can get that from simply reading the RAW data from any message sent in your channel.

Also, I'm not sure why you're using if ($0 == 1) on line 4. It's unnecessary IMO if you've already gotten to that point in your script.

Here's a quick edit of your script that should get things working (again, replace the ######## on line 2 with your own room-id):

Code:
raw USERNOTICE:*:{
  if (($msgtags(msg-id).key == sub) && ($msgtags(room-id).key == ########)) {
    var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
    var %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99)
    msg $1 Thank you %nick for subscribing with a %sub-plan sub! 
  }
}