I just tested the script...when typing in 1212341234 it formatted the number as (12)1234-1234....
so it seems to work...

for that part anyway...
To be able to format more than one number you may need to have some way to differentiate between formats, maybe add a radio button for each format..or checkbox or something of the sort.