I would like to display longer labels given to sections, theorems, and equations in the margin with line breaks so they do not extend outside the margin. I tried the two answers to this question, but neither works with the informs3 document class.
---------- How existing methods fail - Feel free to skip ----------
For the first answer given there, each character in the label wil display in a separate line:

For the second answer, the label will extend into the text body of the page:

---------- End of how existing methods fail ----------
Ideally I want each label to be displayed so that it
- Takes up the entire horizontal space of the margin: from the edge of the paper to the edge of the text body;
- Replaces each blank space with an "open box" (␣) symbol; and
- Breaks the line at any character as needed (including halfway through a word, so that goal #1 is met).
Of course, the label display should not otherwise change the presentation of the document.
Here is a MWE:
\documentclass{informs3}
%Existing methods to display the label
%Method 1 (does not work)
%\usepackage{seqsplit}
%\usepackage{showkeys}
%\usepackage{xstring}
%\renewcommand*\showkeyslabelformat[1]{%
% \noexpandarg%
% % instead of \textvisiblespace you can also put in ~
% % if you want to keep a plain space at space characters
% \StrSubstitute{\(\{\)#1\(\}\)}{ }{\textvisiblespace}[\TEMP]%
% \parbox[t]{\marginparwidth}%
% {\raggedright\normalfont\small\ttfamily\expandafter\seqsplit\expandafter{\TEMP}}}
%Method 2 (does not work)
%\usepackage{showkeys}
%\renewcommand*\showkeyslabelformat[1]{%
% \fbox{\parbox[t]{\marginparwidth}{\raggedright\normalfont\small\ttfamily#1}}}
\TheoremsNumberedThrough %to define theorem-type environments
\begin{document}
\section{The Main Section} \label{sec:a really looooooooooooooooong label for a section}
\begin{equation}
a=b \label{eqn:a long label for an equation}
\end{equation}
\begin{theorem} \label{thm:a long label for a theorem}
Example of a theorem with a long label.
\end{theorem}
\end{document}
