You can enable or disable comments programmatically. Get node using node_load, set comment value and save node.
Source code viewer
<?php #load node using node id $node = node_load($nid); #0 - disabled; 1 - read only; 2 - read/write $node->comment = 2; #save the node $node_save($node); ?>Programming Language: PHP