In NetTalk 6 that code probably won't work because the ID of Save buttons has changed. Because a screen can contain multiple Save buttons it's a lot harder to specify which button you'd actually want to press.
On the up side, the inclusion of jQuery makes it a lot easier to select the button, so that's something.
In terms of where to put this, I'd say, since you want to do it after a lookup, I'd put it in the AfterLookup routine.
In terms of what to put, I think something like this might work;
p_web.Script('jQuery(''#updatemailboxes_div [name="save_btn"]'').click();')
while a complete discussion of jQuery "Selectors" is outside the scope of this reply, suffice to say, you are looking for an element, inside the "element with ID= updatemailboxes_div" with the "name" attribute set to "save_btn".
And then clicking it.
the p_web.Script method is a good way to inject scripts into a reply, because all the hard work of managing context is done for you.
Two things to note,
1) be careful spotting the difference between two single quotes, and one double quote in the above example.
2) the name of the procedure must be "lowered" - ie I've used updatemailboxes in this example, even though the procedure name is UpdateMailBoxes. also notice the _div tacked on to the end of the procedure name.
Cheers
Bruce