There are two ways to add a record to the portal's table:
1) Enable "Allow creation of records via this relationship" for the portal's table in the relationship on which the portal is based. This adds an extra blank row to the portal where you can create a new portal record just be entering data into one of the fields in this row. No scripting required.
2) Write a script: (Subsitute your table and field names for the names used in this example.)
Set Variable [$ID ; value: LayoutTable::PrimaryKey ]
Go to Layout ["PortalTable" (PortalTable) ]
Set Field [PortalTable::ForeignKey ; $ID]
Go To Layout [Original Table]
Both methods have their pros and cons. 1) is simplest to set up but adds that extra row to the portal which isn't always desirable. With larger numbers of portal records, it requires scrolling the portal to the bottom before you can add a new record. 2) Avoids those issues and the portal can be set up to show the newly added row at the top of the portal, but the change in layouts can trip many different script triggers.