Thanks @igorp, but I found out that actually there is a setting in the Account preferences where you can default the behavior of the Item receipts. You can have all the lines checked by default or unchecked by default. That solved my problem. Nothing to do with the script.