The osTicket API only opens tickets and tasks. It does not update tickets.
osTicket matches emails to tickets using:
- "mid" => Message-Id header of incoming mail
- "in-reply-to" => Message-Id the email is a direct response to
- "references" => List of Message-Id's the email is in response
- "subject" => Find external ticket number in the subject line
So I just don't see a way that you would be able to match newly generated emails to old existing ones.