Question
How can I execute a C# script whenever an Opportunity is closed. Is there an API hook/Signal/Event I can use to know when this happens?
Answer
It is definitely possible. You can create a business process, which will be triggered each time the Opportunity status in changed to 'Closed' (https://academy.bpmonline.com/documents/technic-bpms/7-12/signal-start-event) and then you can add your script task afterwards (https://academy.bpmonline.com/documents/technic-bpms/7-12/script-task-process-element).