IIRC the Windows snap feature works “automatically” if you use a native titlebar. Not sure if this is the best route to achieve what you want, though.
If this is a workable solution, this thread has some solutions for how to modify the standalone plugin window.
