Well, it is quite tricky. Here are a couple of ideas, which need to be tested in order to be validated.
One aspect to take into account is WHEN you want to update the fields:
1. While translating
Maybe you can use the Document.SegmentsConfirmationLevelChanged Event, which is triggered when the status of the segment changes. The only thing I do not know is whether the event is triggered before the segment is sent to the TM or after. This should be tested.
If it is triggered before the segment pair is sent to the TM, you could call the project automation API to change the Field Values, which would then be applied when the segment pair is sent to the TM. If it is triggered after the pair is sent to the TM, I would suggest to look into another event, such Document.ActiveSegmentChanged Event and use the Project Automation API to change the field values at that moment.
2. After translation
With this, I mean when your document is completely translated and you want to update your main TM for example. Depending on the criteria you apply to set your field values, you might envisage a conversion of your SDLXLIFF into TMX and apply your field values for each TU in the TMX directly. But this solution is less "clean".
As I said, these are just ideas but maybe you might find something useful to continue your development.