May be helpful I suppose. In case you're not aware though, this is already scriptable:

Code:
on *:dialog:moo:init:0:{
  dialog -s $dname $calc(($window(-1).w / 2) - ($dialog($dname).w / 2)) $&
    $calc(($window(-1).h / 2) - ($dialog($dname).h / 2)) -1 -1
}


Not to mention of course you can use the size line in the table definition to make it centred by default:
Code:
dialog moo {
  ...
  size -1 -1 height width
  ...
}