Yeah, export_vars only knows to look for variables in the local scope.
Use
export_vars ... { info_vars { form\:id {[ns_queryget "form:id"]} } { form\:mode {...similar...}} }
In other words, if an element in the vars list is a two-tuple, export_vars will do a 'subst' on the second element and use that as the value.
See the API-doc for export_vars, this is all explained there.
/Lars