Why did you use get GetHighlight() instead of GetCurrentCtrl()? I didn't use GetHighlight() so I don't really know its intention. Could it be the opening of your prompt dialog shift the highlight such that no tab is thought as highlighted (hench change to -1), ie., it's intended behaviour instead of a bug? Just my thought.
It's a pity you cannot link my package, btw, what's the failure message?