If you're looking to export org-mode specifically, it seems to me like it might be easier (and have more reuse value) as an org-mode exporter. It would probably be a bit more verbose, but it would also be more robust, and error messaging would be more likely to give useful output.