Using scrips to create tickets

I’ve been trying to set up scrips to autocreate tickets, but am having
trouble getting it to do what I want.

For example, I have a custom field set up, “Delivery Required” which just
takes “Yes” or “No”. So, if a ticket requires delivery, a user will change
this to Yes. When this happens, I want a new ticket to be automatically
created in the “Delivery” queue. The current ticket should also then depend
on the delivery ticket.

Does anyone else have a similar setup?