Hi Victor,
What I have understood is- you are creating an Agreement by the project toolbar . True, it will trigger Agreement create event. you can populate the value in Agreement Extension fields which are custom created at created event, it is possible.
If you are setting values of project fields to Agreement fields then you can do it.
I think doc.getExtensionField("XXX").set(object) and it should work.
2 things you need to take care of....the object data type and Extension field data type should be same else you will have to change data type of object by using TypeFactory and 2nd you are saving the agreement by calling doc.IBeanHomeIfc().save(doc) via script.
I have seen this situation and we were able to make it work. Hope the same happens for you
Regards,
Kumud