I also have the requirement to use select2.js in my own add-on, in particular for "improving" some SELECT
elements of a Dexterity content-type within the edit view. So I created a small JS registered with my add-on in order to trigger the select2 functionality upon loading
pretty sure you can use the select2 pattern by using a directives.widget to insert class="pat-select2" on your select input. Patterns aren't meant to be used from javascript but from html. You can use it as above only if you use requirejs to import select2 code. Thats my understanding anyway.