OnScriptShutdown is called when the Tool is shutting down. The ShutdownType defines what the Tool should do. For Complete-style Tools, there is no difference, but for Accept/Cancel-style Tools, on Accept the Tool should "commit" whatever it is previewing/etc, and on Cancel it should roll back / do-nothing. Which of these occurs is based on the ToolShutdownType property.