You could try using the ZO built in prehook. As far as I know there is no posthook though so it'll run before the default code does
Lua Code:
ZO_PreHookHandler(ZO_PlayerInventoryTabsButton7, 'OnMouseUp', function(...)
-- do your stuff here, the ... is the variables passed
end)