Maybe you could make 2 dummy buildings?
"ResearchX not Researched"
"ResearchY not Researched"
Give these to every player who can research that, then add requirements for ResearchX, the building "ResearchY not Researched" and Vice Versa.
Make these buildings for each player that can research X and Y.
Instead of doing idodik's imaginary Action, just do "Remove ResearchY not Researched from the game" ... and Vice Versa.