Hi Benjamin,

If you can't switch the catcode of & before looking for the
optional argument, as David suggests, you can use the !
argument modifier to disallow a space token before the
first “[”:

\NewDocumentEnvironment { sdapsarray } { !o }

in which case:

\begin{sdapsarray}
  & b
\end{sdapsarray}

will work as expected, but:

\begin{sdapsarray} [] % note the space before the []
  & b
\end{sdapsarray}

and:

\begin{sdapsarray}
  []
  & b
\end{sdapsarray}

won't see the optional argument anymore.

Best,

Phelype