I use Fedora Linux and when I installed Surge XT via Flathub, it seems to have put the plugin files in /usr/lib64 instead of /usr/lib (both Ardour and Audacity still detect these files just fine despite the different directory). To keep all my plugin files in the same place, I follow this same practice when installing plugins manually.
I suggest adding conditions in the install script to check whether usr/lib64/vst3, usr/lib64/lv2, and usr/lib64/clap exist or not. Let me know what you think, thanks!