bind it to the right events in a proper addon and you could have it automatically hand-in any completed quest when you talk to the npc, similar to how the AV ones run atm (unless thats one of my existing addons playing silly buggers again)
There already is an addon made for this, it's called Turn In