If you use 'DEFINE WRITE_INT 1' then the library code will disable interrupts around the unlock and setting EECON1.WR to initiate the write operation, but unlike the sequence shown in most datasheets it will reenable them before the write operation is completed.