I made the recommended if->elsif changes. As a test, I added the SpellFinished function to the commonlands port. It's still insta-casting when I say Commonlands though. Code I'm using is below. I'm wondering if this is going to work since the NPC isn't casting the port spell, the player is self-casting it.
Code:
elsif ($text=~/Commonlands/i) {
quest::say("Off to West Commonlands!");
quest::selfcast(34);
$npc->SpellFinished(531, $client)
quest::selfcast(531);
}