How to disable/enable a context programmatically
Use the context_status to enable/disable contexts.

This variable is an array with context names as key and TRUE as value: each of this context is disabled. 

To disable a context: add a new pair to the array like this: 

$contexts = variable_get('context_status', array());
$contexts['context_name'] = TRUE;
variable_set('context_status', $contexts);


To enable a context: unset the context name from context_status.

$contexts = variable_get('context_status', array());
unset($contexts['context_name']);
variable_set('context_status', $contexts);


Also you can use Features, exporting the context_status to a feature.