jibe
The Primary ibay is slightly different than other ibays in that it has default settings that are not easily changed.
So as has been previously advised to you, it is best to avoid using the Primary ibay.
I never use it & always point any main domain to a specific ibay as there is better control possibilities with regular ibays.
/opt does not have default ibay configuration possibilities or limitations. You will have to specifically configure those settings.
/opt is a safe place to put scripts as they are not accessible to Internet users unless you specifically allow it, although the sme server system can access /opt. You may have to configure settings within apps & set suitable permissions to allow that.
It is indeed my suggestion that you put your scripts into /opt/subfolder
ibays are special places & have a lot of default protection enabled, sme by default is locked up very tightly, something which newcomers find hard to deal with, when coming from other Linux distros which are somewhat more open but less secure.
I strongly suggest you install some of the web contribs that install to /opt & examine the templates that they install as you will see how to configure /opt appropriately to allow web access etc, & set up aliases eg Joomla, maybe Gallery IIRC, Wordpress & quite a few others, see the Contribs page & the Howtos. Look also at the Contrib or Howto that lets you manually setup any web app etc (forget it's name off the top of my head & I'm on a mobile so less easy to look it up).
Edit: See for example
http://wiki.contribs.org/SME_Site_Makerand
http://wiki.contribs.org/Web_Application_RPM