Macros inside pstricks parameters

The optional parameters passed to any PStricks object is not expanded. You can redefine the macro that captures the optional parameters - \pst@@object - to use an \edef instead of a regular \def:

\makeatletter
\def\pst@@object#1[#2]{%
  \edef\pst@par{#2}% Changed from \def to \edef
  \@ifnextchar+{\@nameuse{#1@i}}{\@nameuse{#1@i}}%
}
\makeatother

A little more elegant is probably to use an etoolbox patch:

\usepackage{etoolbox}

\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\pst@@object}% <cmd>
  {\def}% <search>
  {\edef}% <replace>
  {}{}% <success><failure>
\makeatother

An \edef will expand the parameters once, which is probably sufficient in most cases.

enter image description here

\documentclass{article}

\usepackage{pstricks}
\usepackage{etoolbox}

\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\pst@@object}% <cmd>
  {\def}% <search>
  {\edef}% <replace>
  {}{}% <success><failure>
\makeatother

\newcommand{\myCommand}{fillstyle=solid, fillcolor=red}

\newif\ifBlackAndWhite  \BlackAndWhitefalse

\ifBlackAndWhite
  \renewcommand{\myCommand}{fillstyle=none}
\fi
  
\begin{document}
    
\begin{pspicture}(0,0)(2,2)
  \pscircle[fillstyle=none, linewidth=1mm](1,1){0.5}
\end{pspicture}

\begin{pspicture}(0,0)(2,2)
  \pscircle[fillstyle=solid, fillcolor=red, linewidth=1mm](1,1){0.5}
\end{pspicture}

\begin{pspicture}(0,0)(2,2)
  \pscircle[\myCommand, linewidth=1mm](1,1){0.5}
\end{pspicture}

\end{document}

And here is the output with \BlackAndWhitetrue:

enter image description here


You need to change the expansion order. For simple commands like \pscircle you can define variants that do that for you (\ePScircle below). For more complicated commands this is not so easy. Which is why you may want to considering switching to TikZ, where styles can do all of this with ease.

\documentclass{article}
\usepackage{pstricks}

\newif\ifBlackAndWhite  
\BlackAndWhitefalse    

\newcommand\myCommand{\ifBlackAndWhite  
fillstyle=none%
\else
fillstyle=solid,fillcolor=red%
\fi}
\def\ePScircle[#1](#2)#3{\expanded{\noexpand\pscircle[#1](#2){#3}}} 
\begin{document}
    
\begin{pspicture}(0,0)(2,2)
    \pscircle[fillstyle=none, linewidth=1mm](1,1){0.5}
\end{pspicture}

\begin{pspicture}(0,0)(2,2)
    \pscircle[fillstyle=solid, fillcolor=red, linewidth=1mm](1,1){0.5}
\end{pspicture}

\BlackAndWhitetrue  
\begin{pspicture}(0,0)(2,2)
    \expanded{\noexpand\pscircle[\myCommand, linewidth=1mm](1,1){0.5}}
\end{pspicture}

\BlackAndWhitefalse  
\begin{pspicture}(0,0)(2,2)
    \expanded{\noexpand\pscircle[\myCommand, linewidth=1mm](1,1){0.5}}
\end{pspicture}


\BlackAndWhitetrue  
\begin{pspicture}(0,0)(2,2)
    \ePScircle[\myCommand, linewidth=1mm](1,1){0.5}
\end{pspicture}

\BlackAndWhitefalse  
\begin{pspicture}(0,0)(2,2)
    \ePScircle[\myCommand, linewidth=1mm](1,1){0.5}
\end{pspicture}
\end{document}

enter image description here