How to override a ctools plugin from another module
I am not entirely sure if this is the best solution but I ended up doing the following:


implemented hook_ctools_plugin_pre_alter()



function my_module_ctools_plugin_pre_alter(&$plugin, &$info) {
      if ($info['type'] == 'behavior' && $info['module'] == 'entityreference' && $plugin['class'] == 'EntityReferenceBehavior_EntityQueue') {
        $plugin['class'] = 'EntityReferenceBehavior_EntityQueue';
        $plugin['path'] = drupal_get_path('module', 'my_module')  . '/plugins/entityreference/behavior';
        $plugin['file'] = 'entityqueue.inc';
        module_load_include('php', 'my_module', '/plugins/entityreference/behavior/EntityReferenceBehavior_EntityQueue.class');
      }
    }



Then I copied the files ('/plugins/entityreference/behavior/EntityReferenceBehavior_EntityQueue.class' and '/plugins/entityreference/behavior/entityqueue.inc') in my module and modified the code of presave function.