http://www.wowwiki.com/API_QuestLogPushQuest

Check out the sample code provided there, shows kinda how to do it.

And yes, you do want an "auto-accept" script on the client.

Please disregard my previous comments about looping, was thinking of another script.