Hello. I've been writing ebuild-related Emacs stuff for some time. See e.g. https://gitlab.com/akater/emacs-ebuild-tools/-/blob/master/ebuild-tools.org for commands diff-ebuilds, find-ebuild, fork-ebuild which I personally find useful.
I didn't try to submit this to the main tree due to general quirkiness of my elisp packaging style but it's rare to see someone being interested in Emacs+Gentoo, so I left you this notice.
ebuild-tools offers some other commands, the section “Suggested config” on the page linked above should give you an idea.
Some lower-level functions might be interesting too.