DB/SAI: Convert a core script to SAI. Fixes issues when abandoning the quest.

Thanks @dr-j for the initial work.