My first suggestion would be to use Visual Studio Code for scripting. It's been instrumental in helping me learn how to script on a basic level.
As far as the script, I would think it's possible. Here is where I myself would start, and then work out the kinks from there. I'm sure a more experienced person has a better way.
Select item.cid
CID 866
if item.cuttype = "decoiled" and item.insulation.status = inside then
item.option["override"]=2
item.update()
end if
item.update()
end select