Auto update / insert price list rate

Hello Guys,

I have added custom fields in price list as follow:

Checkbox: field_1 >>> Auto update price list rate if exist.
Checkbox: field_2 >>> Auto insert price list rate if missing.

I need custom script in Quotation/Supplier Quotation to check if item price exist/missing and update/insert accordingly.

In this case I can achieve insert/update item price for selected price lists only.

Any suggestions for the custom script.

Thank you