1. Open notepad
2. Paste your code in
3. Go to File -> Save As
4. In the "Filename" field type ui.lua
5. In the "Save as type" drop down select "All Files"
6. Click Save
7. Move the file you just made to your scriptbank folder (it should be somewhere like program files/steam/common/steamapps/files/scriptbank)
8. In GameGuru place the item you want to use it on
9. Click on the item you placed and select properties
10. Find the AI field and click the little box at the end
11. Highlight ui.lua and click ok
12. There should be a field in properties to define if it is always active, make it always active.
13. Apply the changes in the property window.
You may have to make the item dynamic in the properties, I can't remember if you need to or not.