COMMIT can be a little bit messy. TRANSACTION END is more intuitive, I think.
Exactly to be not messy I would just ON COMMIT for all, and DOCs can explain that this option is ignored for temp objects and do the same at the end of transaction, independently if commited or rolled back