Drupal 6 Add Webform Programmatically
A webform is simply a node so the rough process of doing this would be to node_load() your particular node, add your components array to the $node->components[] array and then execute a node_save(). There is some documentation here that fleshes out how to programmatically add a webform, your code would look something like this:

$node = node_load(YOUR NODE ID);
$components = $components = array(); #YOUR COMPONENTS ARRAY
$node-&gt;webform = array(
      'components' =&gt; $components,
);
node_save($node);