Bud,
Try this:
1. Save the code ie copy and paste it into Notepad.
2. Save as a .js file, ie Fix Rows and Columns.js
3. Open PixInsight
4. Select the menu entry "Script|Feature Scripts"
5. Press the "Add" button and select the directory where you saved the .js file
Now the Script can be used from the menu "Script|Utilities|Fix Rows and Columns"
See if that works.
Steve