I didn't try this but I bet it works: use hook_form_alter() to access your block configuration form. There, you will have a &$form_state and be able to do fancy AJAX stuff (see this).
The hard part is to ONLY alter YOUR form at the alter-hook. Possible ways:
Not sure if this works (most elegant way):
function mymodule_form_alter(&$form,&$form_state,$form_id) {
if ($form_id == 'block_admin_configure' ) {
// Find the delta in the $form variable
if ($form['delta'] == 'the_delta_you_are_looking_for') {
//do fancy ajax stuff
}
}
}
Ugly but definitely possible:
function mymodule_form_alter(&$form,&$form_state,$form_id) {
if ($form_id == 'block_admin_configure' && arg(4) == 'mymodule') {
//do fancy ajax stuff
}
}
}
Even uglier but also possible:
function mymodule_block_configure($delta = '') {
$form = array();
if ($delta == 'my_block') {
$form["my_block_change_this"] = array(
"#type" => "hidden",
"#value" => "lalala",
)
}
}
function mymodule_form_alter(&$form,&$form_state,$form_id) {
if ($form_id == 'block_admin_configure' ) {
if (!empty($form['my_block_change_this'])) {
//do fancy ajax stuff
}
}
}
Tip: Print out the form_state-array (at the alter hook) and see what's there (That's always the first thing I do when I run into FAPI-Issues). Hope this helps.