How to determine whether the quest has been completed, after the quest has been turned in.
/script print(IsQuestFlaggedCompleted(QUESTID))