La différence entre `MetaPost` et `pstricks` comme second langage est que `pstricks` a `alsoother={0123456789$_},%`. `alsoother={0123456789$_}`. Si vous ajoutez ceci le sum est coloré :
    \documentclass{article}
    \usepackage{xcolor}
    \usepackage{listings}
    
    \lstset{%
      language=[AlLaTeX]TeX,
      alsolanguage=MetaPost,
      texcsstyle=\color{blue},
      basicstyle=\ttfamily,	
    	alsoother={0123456789$_},%
    }
    
    \begin{document}
    \begin{lstlisting}
     $\sum_{n=1}^\infty\frac{1}{n^2}$.
    \end{lstlisting}
    \end{document}
![alt text][1]
  [1]: https://texnique.fr/osqa/upfiles/Screen_Shot_2019-10-17_at_13.34.37.png