How to use custom function to copy fields in one module to my contacts module?

How to use custom function to copy fields in one module to my contacts module?

I have created a module for client policies in CRM.  I would like to write a custom function that would copy some of the data fields under each policy to certain fields in my contacts/clients module.

The issue is there are multiple policies and data from each policy entry (type, amount, effective date, etc) would need to go in certain fields in contact/client module.

It would seem if there was an in/then statement in the custom function; this would be possible.

If policy type is "XYZ" then copy
"policy data field1" ---> "contact data field1" in contact/client module.
"policy data field2" ---> "contact data field2" in contact/client module.
"policy data field3" ---> "contact data field3" in contact/client module.

If policy type is "ABC" then copy
"policy data field1" ---> "contact data field4" in contact/client module.
"policy data field2" ---> "contact data field5" in contact/client module.
"policy data field3" ---> "contact data field6" in contact/client module.

Any input would be greatly appreciated.