Edit : use inheritance of classes

You can avoid dangerous deletion by using persistence classes definition and preserve convergence.

Example with comma-separated strings :

bundle agent sys_name_resolution_handler(prefix, params)
{
  vars:

    any::
      "$(prefix)editTable" string => "function_vars.$(prefix)edit";
      "$(prefix)editIdex"  slist  => getindices("$($(prefix)editTable)") ;

  methods:

      "$($(prefix)editIdex)"
        usebundle => resolver_vars(
                                 "$(prefix)",                                                # prefix
                                 @(sys_name_resolution_vars.sys_name_resolutionedittypes), # list
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][file])",                # file
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][nameserver])",          # nameserver
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][search])",              # search
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][domain])",              # domain
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][option])",              # option
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][sorlist])"              # sorlist
                               );
      "$($(prefix)editIdex)"
        usebundle => doresolver(
                                 "$(prefix)",                                                # prefix
                                 @(sys_name_resolution_vars.sys_name_resolutionedittypes), # list
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][file])",                # file
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][nameserver])",          # nameserver
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][search])",              # search
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][domain])",              # domain
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][option])",              # option
                                 "$($($(prefix)editTable)[$($(prefix)editIdex)][sorlist])"              # sorlist
                               );
}

bundle agent resolver_vars(prefix,list,file,ns,s,d,o,sl)
{
vars:

   "nameserver" string => "$(ns)";
   "search"     string => "$(s)";
   "domain"     string => "$(d)";
   "option"     string => "$(o)";
   "sorlist"    string => "$(sl)";

  classes:

    "$(prefix)$(list)_ok"
      not         => strcmp("$($(list))",""),
      persistence => "1"; #global
}

bundle agent doresolver(prefix,list,file,ns,s,d,o,sl)
{

  vars:

    "nameserver" slist => splitstring("$(ns)",",","99");
    "search"     slist => splitstring("$(s)",",","99");
    "domain"     slist => splitstring("$(d)",",","99");
    "option"     slist => splitstring("$(o)",",","99");
    "sorlist"    slist => splitstring("$(sl)",",","99");

  files:

    "$(file)"
      create        => "true",
      edit_line     => editresolv(
                                  "$(prefix)",
                                  @(this.list),
                                  @(this.nameserver),
                                  @(this.search),
                                  @(this.domain),
                                  @(this.option),
                                  @(this.sorlist)
                                 );
#      edit_defaults => empty;
}

bundle edit_line editresolv(prefix,list,ns,s,d,o,sl)
{

  insert_lines:

    "nameserver $(ns)";
    "search $(s)";
    "domain $(d)";
    "option $(o)";
    "sorlist $(sl)";

  delete_lines:

    # To clean out junk
    "$(list) .*"
      ifvarclass => "$(prefix)$(list)_ok";
      #not_matching => "true",
}