Turn index match statement into Google Script

I am combining tables from different sheets into one on google sheets. What I am trying to do is set up a function onedit(e) may be combined with a loop function to run this

=index($G$2:$G$8,match($A10&$I$1,arrayformula($B$2:$B$8&$E2:$E8),0),"").

I am new to google script so I have just tried using formulas but the formula updates all cells next to it and what I want is that it matches and stays so that next time column G gets updated then the result be added to B10 instead of rewriting A10. (I1 has formula =today() so that it has a place of reference but if the code can just match with the date then that would be great!)

Here is the link to the sheet if you would like to see what I am talking about. https://docs.google.com/spreadsheets/d/1jviYYhI1V_bL8TMVvijR9vo_7sBFfktbhgblGNcYfrQ/edit?usp=sharing

Column B2:B8 are drop-downs that are based on the list from A10:A18 if that makes any difference. Any help would be greatly appreciated I've been looking for 3 days and can't find something that would do this.