1) if you open manage | scripts, you can find and open the Print Invoice script. It changes to a different layout and the design of that different layout is why the printed invoice looks different from the data entry screen, for one thing it uses a list view layout based on the "invoice data" or "line items" table instead of printing from invoices with a portal.
2) This is not a script. It's a calculation field. It simply changes the text returned from singular to plural based on the value in the field.