Q:

How can I force expansion within this optional argument?

Oh look, a real question!
In trying to actually complete something, I came across the following limitation of this lambda macro creator: it apparently does not work in the use case it was intended for.  It's certainly a problem with expansion control, but I don't know where to really start.
\documentclass{article}

% (David Carlisle / @Manuel)'s much simpler version
\newcommand\LambdaFunction[2][0]{%
  \let\tmp\relax
  \newcommand\tmp[#1]{#2}\tmp}

\usepackage{empheq}

\begin{document}
\begin{empheq}[
  box={\LambdaFunction{%
      \colorbox
      {myblue}%
      {\hspace{1em}#1\hspace{1em}}%
    }%
  }
  ]{align*}
  a   &= b   \\
  a^2 &= b^2
\end{empheq}
\end{document}

A:

You missed out the color package:-) also my version defaulted to [0] rather than [1] so I had to add [1]. Then you need to double # just because.
\documentclass{article}

\usepackage{color}

% (David Carlisle / @Manuel)'s much simpler version
\newcommand\LambdaFunction[2][0]{%
  \let\tmp\relax
  \newcommand\tmp[#1]{#2}\tmp}

\usepackage{empheq}

\begin{document}
\begin{empheq}[
  box={\LambdaFunction[1]{%
      \colorbox
      {blue}%
      {\hspace{1em}##1\hspace{1em}}%
    }%
  }
  ]{align*}
  a   &= b   \\
  a^2 &= b^2
\end{empheq}
\end{document}

