Hi Neil
About a year ago, you already had almost exactly the same task:
https://community.wappler.io/t/need-help-with-multiple-update-and-insert-server-action-steps/21167/13?u=mr.rubi
The site specified in the solution with a working example is no longer available, but you can view it at this address: https://howitisdone.cy65837.tmweb.ru/arrayinsc.html
It seems to me that this solution can be successfully applied to your current task.