@JTRTech is correct here. There should be no reason to want to log a reason for Cancel.
That said, the features you are requesting to have added already exist. The Topic has been re-categorized as a Question rather than a Request.
You can control button permission in the Automation Command Mapping …
To log a Cancel Reason (the same could be applied to Void, or any Automation Command button for that matter)…
Action - Add Line to Text File
Rule - Automation Command Executed for Cancel Button
There is even a post regarding Gift & Void Reason …