This should be possible using the existing knowledge Geany has about the errors in the compiler tab and the corresponding lines in the text buffer. No extra UI elements are needed. Just bring the compiler tab to foreground and let it scroll to the first error which corresponds with the active line in the text buffer.
Geany does not keep file/line information for the compiler messages, when the user clicks a red line in the compiler tab it parses _that line_ for the file/line info. To go the other way would mean parsing all compiler error lines until the current line is found every time its needed, probably ok on a user command like "show current line error" menu and keybinding, but not every line movement in the editor, some compilers can generate a lot of errors to search, and not in order either. If a map of file/line to treeview item was created that would be better (but Geany is not C++ where std::map would be easy, its "plain olde C" so more effort is needed) and of course it needs clearing and re-creating on compile.
Similarly changing the message window tab and scrolling the treeview should be on user command, not just edit window movement, the user may want to keep looking at whichever tab they have open whilst editing, or keep the error message they are working on whilst looking at another line of code they think is involved, and Geany should not change it uncommanded.
If "somebody" (that doesn't necessarily mean you, but it means not me ;-) makes a neat PR based on the above menu and keybinding command and map design I would think it could be accepted.