I don't quiet see why you would retain a line item record but delete the invoice record it is related to. I can see splitting an invoice or moving an existing line item from one invoice to another, but not creating an "orphan" line item that is not linked to any existing invoice as such a record cannot be billed until it is associated with another invoice record.
Scripts can do all of the above. You can also do them manually by editing the value of the Match field in the line item table, but I do not recommend that you do that manually as a mistake can easily produce such "orphan" line items.
So yes, you can change line item records in the portal, this is another case where you simply edit a field in the portal, but I don't think that it's a good idea to do so without some scripted support.
my line items essentially are tracking time, at some point usually at the end of the month I will run an invoice, where i will put in the dates when the invoice period starts and the end point. I want to then gather all the line items up that are in that period and put them in an invoice. at that point I want to assign a invoice number so that I can look for line items that haven't been billed and avoid line items going on two invoices.
are there any scripting commands that look at a portal?
Then you can use a combination of client ID and a date range to link an invoice to a new set of billing entries. You can perform a find on the line items table for them and use replace field contents to link them to a new invoice.
Say you create a new invoice and select the customer for it from a value list. Then enter the desired dates into a pair of date fields to specify the range and click a button that performs this script:
Set Variable [$CustID ; Value: Invoices::_fkCustomerID ]
Set Variable [$DateStart ; Value:Invoices::DateStart ]
Set Variable [$DateEnd ; Value: Invoices::DateEnd ]
Set Variable [$InvoiceID ; Value: Invoices::__pkInvoiceID ]
Go to Layout ["LineItems" (LineItems) ]
Enter Find Mode  ---> clear the pause check box. Do not specify find criteria here
Set Field [LineItems::_fkClientID ; $CustID ]
Set FIeld [LineItems::Date ; DateStart & "..." & DateEnd ]
Set Error Capture [on]
Perform Find 
If [Get (foundCount ) ]
Replace Field Contents [no dialog ; LineItems::_fkInvoiceID ; $InvoiceID ]
Show Custom Dialog ["No records were found"]
you are a star i will try that over the weekend:-)