OPC UA struct data type?

Hi at all,
I have created derived opc tags as indicated, all UDT and therefore all derived tags work correctly both in reading and writing.

My problem is, I created a button that via script sets 2 derived tags at the same time to value 0 within a parameterized popup:

the script is as follows:

if system.gui.confirm (u'Are you sure? ',' Confirm '):
    event.source.parent.DVC_Popup.C_Moff = 0
    event.source.parent.DVC_Popup.C_Mon = 0

Only the C_Mon tag is set because the values ​​are changed in the same time, i thinkj before the update time of the OPC tag from which the tags are derived.
If between one tag and another I put a delay of 2 seconds the tags are written, I think because I give to driver time to update the OPC tag.

from time import sleep
 
if system.gui.confirm (u'Are you sure? ',' Confirm '):
   event.source.parent.DVC_Popup.C_Moff = 1
   sleep (2)
   event.source.parent.DVC_Popup.C_Mon = 0
   sleep (2)

Is there any way to avoid inserting this delay? or another way to write derived tags at the same time?

Thanks