OnLayoutEnter is only tripped when you enter the layout. Then your script only modifies the field on the current record, none of the others. If you change records nothing happens as you have not tripped the OnLayoutEnter. If you change to a different layout and return, you trip the layout again and again only the current record is modified.
Set FIeld is an excellent way to change one field of one record. If you want to change the value of a given field in every record of your found set, use Replace Field Contents.
Hint: Replace Field Contents can modify hundreds of thousands of records in one batch operation and cannot be undone. It's a good idea to save a back up copy of your file before trying to use replace field contents so that you can discard your current copy of the file and switch to the back up copy of it does not work the way you expected.