For gumps that use the legacy Generic Gump system (for non-modders, if it looks identical to the one in 2D, it's almost definitely using the legacy GG system; for modders, I mean the ones not defined in Lua/XML), I have so far been unable to find any way to interact with them nor override them entirely.
For gumps that do not use that system, and are instead defined in the Lua, it is possible to make mods (and in some cases, commands) to effectively allow automated button clicks.
edit::
Animal Form falls in the first category, FYI.