Possible to use same script for two subforms (that are identical)?

Possible to use same script for two subforms (that are identical)?

Hi,

My current script is super long, I hope there's a way to make it shorter:

I have a main form, with two subforms in it.
The subforms are completely identical, it's just that I had to display them twice on the same form and Zoho would not let me add the same subform twice.
I have a pretty long script that needs to be run for each subform on On Edit -> On Validate. is there a way I can use the same lines for both subforms?

To make thing easy I'll elaborate a bit: 
The subforms have 3 fields: Date, Amount and Accout (2 options in drop-down) - they are used to list money transfer to two different accounts.
if possible, it would be great to use the same form twice in the main form, and in each to show (and add) just one account.
since not possible, I've created a separate form for each account, but now I have to run the entire script twice - for each subform.


is it possible to have it run "for each" subform? or something of that sort?

Important thing is that I use a lot of old. variables.... 


Thanks