To get a border for an image you can use the command \framebox{}
. To define the width of the rule you can use command \setlength{\fboxrule}{0.5pt}
.
Both combined leads to the following
\newcommand{\munepsfig}[4][scale=1.0]{% <===============================
\begin{figure}[!htbp]
\centering
\vspace{2mm}
\setlength{\fboxrule}{#4} % <===================================
\framebox{\includegraphics[#1]{#2.png}} % <=====================
\caption{#3}
\label{fig:#2}
\end{figure}
}
Now you can use the command
%\munepsfig[option]{figure}{caption}{fboxrule}
\munepsfig[width=5cm]{example-image}{caption of figure}{1pt}
to print the image example-image
with an border of 1pt
.
The complete MWE
\documentclass{article}
\usepackage{graphicx}
\newcommand{\munepsfig}[4][scale=1.0]{% <===============================
\begin{figure}[!htbp]
\centering
\vspace{2mm}
\setlength{\fboxrule}{#4} % <===================================
\framebox{\includegraphics[#1]{#2.png}} % <=====================
\caption{#3}
\label{fig:#2}
\end{figure}
}
\begin{document}
%\munepsfig[option]{figure}{caption}{fboxrule}
\munepsfig[width=5cm]{example-image}{caption of figure}{1pt}
\munepsfig[width=5cm]{example-image-a}{caption of figure2}{0.5pt}
\end{document}
gives you:

To get rid of the space between image and rule use command \setlength{\fboxsep}{0pt}
. See the following new MWE
\documentclass{article}
\usepackage{graphicx}
\newcommand{\munepsfig}[4][scale=1.0]{% <===============================
\begin{figure}[!htbp]
\centering
\vspace{2mm}
\setlength{\fboxrule}{#4} % <===================================
\setlength{\fboxsep}{0pt} % <===================================
\framebox{\includegraphics[#1]{#2.png}} % <=====================
\caption{#3}
\label{fig:#2}
\end{figure}
}
\begin{document}
%\munepsfig[option]{figure}{caption}{fboxrule}
\munepsfig[width=5cm]{example-image}{caption of figure}{1pt}
\munepsfig[width=5cm]{example-image-a}{caption of figure2}{0.5pt}
\end{document}
resulting in the pdf:
