I have reviewed your code and noticed that you were trying to copy the value of the physical address street number to the mailing address street number at the following line.
mStreetNumberStr = pStreetNumberStr;
However, this does not change the field value because it only puts the value in the variable and the value of the event object is not overwritten.
*If you look at the contents of the event before the return event, you can see that the value has not changed.
This is a JS constraint, but when you put a variable in a variable and pass it by a type other than an object（I think that it is a string type because it is an address.), the original value is not overwritten.
With your code, a variable is put in a variable a few times,but it is passed in a way that's not an object at the following line,
so it ends up that an event object is not overwritten.
var mStreetNumberStr = record.mailingaddressstreetnumber.value;
Therefore, I would suggest changing the following two lines as below to make it work.
Current: var mStreetNumberStr = record.mailingaddressstreetnumber.value;
Change to: var mStreetNumberStr = record.mailingaddressstreetnumber;
Current: mStreetNumberStr = pStreetNumberStr;
Change to: mStreetNumberStr.value = pStreetNumberStr;
Regarding the above restrictions, the details are described below.