BTW, here is an experience I have had today.
I have a purchase orders layout with a portal showing line items.
I have a modal dialog that shows to choose items and a semi complex script to create the line items records.
What was happening is that everything worked fine except the portal would still be empty after choosing items to add. This is despite the line items script committing records and despite there being a refresh window (flush cached join) being in place. Dropping into layout mode and back to browse mode fixes the problem in every case.
I then tried putting in another Refresh Window script step which had no effect.
I then put in a commit records at the end (affecting the PO record - not a line item record) and this fixed the problem. Note the PO record in question is months old and was definitely committed.
So seems bugginess to me. Just thought it was worth sharing.