I think you actually want to wrap this in a condition-case so you don't get an error if there's no closing ] for the export.

Like this:
(condition-case ex
                (progn
                  (forward-sexp)
                  (> (point) oldpoint))
              (error t))

I'm assuming that we're still in the export statement when there's no matching ]. I think that should be correct in most cases.