Go to Portal Row [last]
will put the focus on the last (add) portal row.
Go to field can then put the cursor in the field.
If there is more than one portal, give the line items portal an object name and start this process of with a go to object step to first put the focus on the correct portal, then go to the row, then the field.
WIth the right triggers and by configuring your scanner to trip them, this can be automated to the point that the user just starts scanning items and everything is processed automatically.
There is no configuration options for the barcode scanner
That's very unfortunate. Most scanners come with a way to configure them so that they can append text to the beginning or end of the text scanned off of the barcode. I"d check with the scanner manufacturer to make sure that this really can't be done
Then the OnLayout Keystroke trigger can pefrom a script that checks for special keystrokes that precede the scanned text in order to put the focus in the correct field. Then the settings can also be set to append a return, enter or tab character to the end of the text so that the field is immediately exited when the scan is complete. That can then trip a second trigger such as on object exit to perform a script to process the scanned data if you need that capability and users can then get the same results by manually entering data and pressing the same tab, enter or return key--such as when a barcode won't scan because it's damaged or the scanner has broken down.
Here's a link to a thread on the method: Need help writing script to integrate barcode scanning