Raso,
Its looks a little hard to get the second value with reference to the first one. I would simple first find the first one then come up with some logic (if ,do while ..conditions) and then get the second value with a new web_reg_save_parm..etc.
I am sure there are other ways.
Good luck
-Arjun