There are examples included in the SDK that do just this. Look for the LocalLBNode sample in each of the supported languages (Perl, Java, VB, C). When you mention scripting this, perl is probably your best option.
The specific methods you would be interested in are:
void ITCMLocalLB::Node::set_state(
in IPPortDefinition[] node_defs,
in EnabledState state
);
void ITCMLocalLB::Node::set_availability(
in IPPortDefinition[] node_defs,
in AvailabilityState state
);
void ITCMLocalLB::Node::get_statistics(
in IPPortDefinition node_def,
out NodeStatistics stats
);
The set_state() method will cause a forced up or down of the node while the set_availability() method is used for gracefully "draining" connections to the node by not allowing new connections to be pass on. If using this method you should watch the connections on that node with the get_statistics() method and wait until the total connections reach zero, then disable the node with the state of STATE_DISABLED.
-Joe