I don't think there's anything that qRules can do to help you. Unfortunately, it's a tricky scenario. For example:
(a) If I click the # button for the first line item, its serial number will be SN1203001, right? And if I click the second line item, the serial number will be the same, because the form is checking the Sharepoint list and not the item right above it in the form, correct?
(b) You'll have to parse the serial number because InfoPath cannot handle SN1203000 + 1. So you'll need something like concat("SN", 1203000 + 1).
(c) What if two users open the form, and then both click the # button. When they submit, you'll end up with two line items with identical serial numbers.
Anyway, again, I'm sorry but I don't think qRules can help in this case. I'm sorry that the above probably doesn't help; just some things to think about.