How can I create an add-on item script for gift boxes?

Hi All,

I am trying to create an add-on item script for the following use case.

I would like to add a gift box add on item for a flat price if the customer says the product they choose is a gift for someone.

Anyone has a sample script, i can use to get a jumpstart?

Thank you!,

Siva