Code:
alias acomp {
  var %dialog = acomp
  if ($dialog(%dialog)) /dialog -vie %dialog
  else /dialog -md %dialog %dialog
}

dialog acomp {
  title "Auto Complete"
  size -1 -1 120 63
  option dbu
  combo 1, 0 0 60 50, sort size edit
  combo 2, 60 0 60 50, sort size edit
  button "Close", 3, 80 50 40 12, ok
}

on 1:DIALOG:acomp:INIT:*: {
  /acomp.init $dname 1
  /acomp.init $dname 2
}

on 1:DIALOG:acomp:EDIT:*: {
  /autocomp $dname $did
}

alias acomp.init {
  var %dname = $1, %did = $2, %a = 0
  while (%a < 100) {
    /did $iif(%a == 0, -ca, -a) %dname %did $+($rand(a,z),$rand(a,z),$rand(a,z),$rand(a,z),$rand(a,z))
    /inc %a
  }
}

alias autocomp {
  var %dname = $1, %did = $2
  var %a = $did(%dname, %did).lines
  while (%a > 0) {
    if ($did(%dname, %did1).text iswm $did(%dname, %did, %a).Text) {
      /did -c %dname %did %a
      return
    }
    /dec %a
  }
}


To solve your multiple dropdown problem all i did was make the function an alias, then used it for both the id's. I send it dname and id, and it took care of the rest.

(Sry ruby for using you as the eploy to, but u were the closest to bottom >:D)