Enter Layout Mode on your layout.
Double click your portal, but do this below the single row of fields you see for your portal row when you are in layout mode. This opens the Portal Setup Dialog.
Use the portal set up dialog to sort your records into the order you want to see for display purposes. The details here will depend on what you have set up for the portal records. If there is a field that auto-enters a serial number you can select that field for sorting. If there is a timestamp field that auto-enters the creation timestamp, you can select it. In either case, specify a descending (Large to small) sort order to put the most recently created record at the top of the portal.
Note that no script is actually needed to " insert the account name and date" as you can define a text field land a date field to auto-enter this information every time a new record is created in the portal's table.
And many times, it is helpful to put a "new note" button on your layout that creates a new portal record when you use such a "most recent record at the top" design for it as clicking such a button will create a new blank record at the top of your portal and this avoids having to scroll to the bottom of the portal everytime you want to add a new note.
Can someone point me in the direction to learn about them. I literally don't understand them at all.
This forum is a good place to ask specific questions. To gain more general knowledge about fileMaker, you'll need to invest some time in one training resource or another. Which resource is best can be different for each person learning FileMaker as much depends on what skills and experience each individual brings to the learning process.