That can be done. Self join relationships that match on the unique value field can be used to check for duplicates, but maybe there is a better way.
What if the user filled in the info in some global fields and then clicked a 'save' button to add it to the table? The 'save' button's script could do a search for the record, if it finds one, it can update it with the new data (perhaps after showing the existing record and getting confirmation in case this is actually a mistaken entry.) If it does not find one, it can create a new record and move the data from the global fields to the newly created record.
I thought about the global field to fill and a second TO of Line_inventory_check for another filtered portal to show me eventual double entries. But I can't get the script steps to make it work.
I got confused when is time to make it perform a find and get back to the right field of the portal with the IF script, or make appear the dialog box to set the quantities to add.
I suggest breaking that down into sub projects and seeing where a problem is encountered.
Can you get a script to find records using criteria entered in global fields?
If that works, then you can use the data to create a new portal record. You don't actually have to set the script to interact with the portal, you can do all the work on a layout based on the portal's table (update the found record or create a new one), then switch back to the original layout. If you freeze the window, the user doesn't see the change in layouts take place.