A plain TeX one with a different syntax
\def\bforall#1{\forall#1\,\futurelet\tmptoken\dobforall}
\def\dobforall{\ifx\tmptoken\bgroup\expandafter\bforallbraces\fi
\ifx\tmptoken[\expandafter\bforallbrackets\fi
\ifx\tmptoken(\expandafter\bforallparenthesis\fi
\relax}
\def\bforallbraces#1\relax#2{\{#2\}}
\def\bforallbrackets#1\relax[#2]{[#2]}
\def\bforallparenthesis#1\relax(#2){(#2)}
$\bforall{x}(x \in A)$\par
$\bforall{x}{x \in A}$\par
$\bforall{x}[x \in A]$\par
\bye

You can use those definitions also in LaTeX without the need of any package. The syntax seems easier for me \bforall{x}(x\in A)
, \bforall{x}{x\in A}
and \bforall{x}[x\in A]
. In any case, for your needs, may be you don't need that macro at all, just \def\bforall#1{\forall#1\,}
and then it's followed by whatever you input?
With a little bit of refinement to let you use \bforall x {x \in A}
syntax. (In LaTeX it would be easier because of \@ifnextchar
.)
\def\bforall#1{\forall#1\,\futurelet\tmptoken\dobforall}
\def\dobforall{\ifx\tmptoken\spacetoken\expandafter\bforallspace\fi
\ifx\tmptoken\bgroup\expandafter\bforallbraces\fi
\ifx\tmptoken[\expandafter\bforallbrackets\fi
\ifx\tmptoken(\expandafter\bforallparenthesis\fi
\relax}
\def\bforallbraces#1\relax#2{\{#2\}}
\def\bforallbrackets#1\relax[#2]{[#2]}
\def\bforallparenthesis#1\relax(#2){(#2)}
\def\bforallspace#1\relax{\dobforallspace}
\expandafter\def\expandafter\dobforallspace\space{\futurelet\tmptoken\dobforall}
\lowercase{\let\spacetoken= } %
$\bforall x (x \in A)$\par
$\bforall x {x \in A}$\par
$\bforall x [x \in A]$\par
\bye