How can I trigger a selection for a Select2 EntityRef element via javascript?
According to this related question, it should be possible to do this via:

$('#id-of-select2').select2('val', 'value-to-select');


or, if you want to select multiple items in a multiselect:

$('#id-of-select2').select2('val', ['value-to-select', 'another-value']);