O and P are the two opposite corners of the frame
O=south west and P=north east
your example changed for line from south west -- south east

\documentclass{article}
\usepackage{kantlipsum}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shapes, decorations.pathmorphing, decorations.shapes, backgrounds, calc}
\newenvironment{myBox}{}{}
% see: https://tex.stackexchange.com/a/114161/8323
\newcommand\wavydecor{%
\draw[decoration = {coil,
aspect = 0.2,
segment length = 5pt,
amplitude = 1.5pt},
decorate, line width = 0.7pt, black]
(O) -- (O-|P);
}
\mdfdefinestyle{wavyLine}{%
usetwoside = true,
hidealllines = true,
innerleftmargin = 5mm,
innerrightmargin = 4mm,
rightmargin = 2mm,
singleextra = {\wavydecor},
firstextra = {\wavydecor},
secondextra = {\wavydecor},
middleextra = {\wavydecor},
fontcolor = black,
backgroundcolor = white,
splittopskip = 5mm
}
\surroundwithmdframed[style = wavyLine, needspace = 1.5cm]{myBox}
\begin{document}
\begin{myBox}
\kant[1]
\end{myBox}
\end{document}
or from south west to north east

\documentclass{article}
\usepackage{kantlipsum}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shapes, decorations.pathmorphing, decorations.shapes, backgrounds, calc}
\newenvironment{myBox}{}{}
% see: https://tex.stackexchange.com/a/114161/8323
\newcommand\wavydecor{%
\draw[decoration = {coil,
aspect = 0.2,
segment length = 5pt,
amplitude = 1.5pt},
decorate, line width = 0.7pt, black]
(O) -- (P);
}
\mdfdefinestyle{wavyLine}{%
usetwoside = true,
hidealllines = true,
innerleftmargin = 5mm,
innerrightmargin = 4mm,
rightmargin = 2mm,
singleextra = {\wavydecor},
firstextra = {\wavydecor},
secondextra = {\wavydecor},
middleextra = {\wavydecor},
fontcolor = black,
backgroundcolor = white,
splittopskip = 5mm
}
\surroundwithmdframed[style = wavyLine, needspace = 1.5cm]{myBox}
\begin{document}
\begin{myBox}
\kant[1]
\end{myBox}
\end{document}

\documentclass{article}
\usepackage{kantlipsum}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shapes, decorations.pathmorphing, decorations.shapes, backgrounds, calc}
\newenvironment{myBox}{}{}
% see: https://tex.stackexchange.com/a/114161/8323
\newcommand\wavydecor{%
\draw[decoration = {coil,
aspect = 0.2,
segment length = 5pt,
amplitude = 1.5pt},
decorate, line width = 0.7pt, black]
(O) -- (O|-P);
\draw[decoration = {coil,
aspect = 0.2,
segment length = 5pt,
amplitude = 1.5pt},
decorate, line width = 0.7pt, black]
(P) -- (O-|P);
}
\mdfdefinestyle{wavyLine}{%
usetwoside = true,
hidealllines = true,
innerleftmargin = 5mm,
innerrightmargin = 4mm,
rightmargin = 2mm,
singleextra = {\wavydecor},
firstextra = {\wavydecor},
secondextra = {\wavydecor},
middleextra = {\wavydecor},
fontcolor = black,
backgroundcolor = white,
splittopskip = 5mm
}
\surroundwithmdframed[style = wavyLine, needspace = 1.5cm]{myBox}
\begin{document}
\begin{myBox}
\kant[1]
\end{myBox}
\end{document}
(A|-B)syntax says use thexcoordinate of the nodeAand theycoordinate of the nodeB, similarly(A-|B)says use thexcoordinate ofBand theycoordinate ofA. – Willoughby Mar 21 '21 at 13:21OandP? – Colas Mar 21 '21 at 13:24