Tiny auto-dismount and auto-stand addon.
If a spellcast or interaction fails due to being mounted, you will dismount. If it fails due to you sitting down, you will stand up. Let me cast!
CancelShapeshiftForm() is currently protected, and as such auto cancelling shapeshift forms is impossible. This addon will be updated to support druids forms/ghost wolf/shadow form, etc. whenever that changes.
Check out https://www.curseforge.com/wow/addons/letmefly if you are only looking for auto-dismounting when talking to flight masters. Most other cases are already covered by the built-in auto dismount in TBC Classic.