Why do you need to script this at all? A calculation field can compute a portal total (and other values based on that total) and will update as portal records are added/deleted/changed without any scripting.
1) you may have needed to first commit the record before refreshing the window
2) It "repaints" the window--this sometimes gets values in certain fields--from related tables more than one occurrence 'away' from the layout's table occurrence, summary fields from related tables, recently changed variables used in merge text... to correctly display their current values.
3) It's an option to be avoided if at all possible. It completely "requeries" and re-evaluates all calculation fields and links to related fields and any portal filter expressions. In a list view layout with lot's of data, a slow network, an FM GO client etc., it can produce glacially slow screen updates. It can usually be avoided with some creative scripting and/or relationships that use the X operator.