Progress on quests is save in character variables, like sign_q, or kh_quest
You need to go through script files manually, make a list of variables and possible values (0 is "not started", 1~X-1 is "in progress", >X is "finished" usually, where X changes from quest to quest, as they have different number of steps).
Then just check for the variables in script and print a appropriate message.
You're doing it hard way, so I wouldn't expect anybody to write the whole script for you. You got the lineout, and the rest of this absolutely tedious and redundant work is your task