The simplest solution would be to choose some limit for the number of possible tabs (networks). You would hard-code that many tabs into your dialog, and then disable/hide the unused tabs. For example, most people wouldn't ever be on more than 10 networks at a single time, so you could make a dialog with 10 tabs.

Another possibilty is to use a listbox instead of tabs. You would have a listbox on the left, and a single set of items on the rest of the dialog. Whenever you choose one of the listbox items, the script would update the items on the right with the appropriate data.

-genius_at_work