Here's my proposal:
\documentclass{article}
\usepackage{amsmath}
\makeatletter % access "private" commands
\newcommand{\wmat}[1][]{%
\mathop{\wmat@false\mathpalette\wmat@{#1}}%
\!%
\mathop{\wmat@true\mathpalette\wmat@{#1}}%
\nolimits
}
\newif\ifwmat@
\newcommand{\wmat@}[2]{%
\begingroup
\setbox\z@=\vtop{\offinterlineskip
\ialign{%
\hfil$\m@th##$\hfil\cr
#1\mathrm{w}\cr
\noalign{\kern1pt}
\scriptscriptstyle#2\cr
}%
}%
\ifwmat@
\sbox\tw@{$#1\mathrm{w}$}%
\dp\z@=\dp\tw@
\box\z@
\else
\vrule height \ht\z@ depth \dp\z@ width \z@
\fi
\endgroup
}
\begin{document}
\begin{center}
\fboxsep=0pt\fboxrule=0.1pt
$\wmat[2]_i^j$ $\scriptstyle\wmat[2]_i^j$ $\scriptscriptstyle\wmat[2]_i^j$
\fbox{$\wmat[2]_i^j$}
\end{center}
\[
\wmat[2]_i^j
\]
\end{document}
The centered subscript is always in \scriptscriptstyle so as to avoid it making for bad spacing.

The strategy is to define a math operator that accepts an optional argument for the centered subscript. However, this subscript should not influence the vertical size of the ‘w’, in order that the standard subscript and superscript are set to the letter.
So I typeset ‘w with the subscript’ twice, one with \wmat@false and one with \wmat@true. The first instance is used to make a phantom that has the same vertical size of ‘w with the subscript’, placed in a \mathop atom of its own. The second instance is also typeset in a \mathop atom; a \! between them removes the space that TeX adds between consecutive \mathop atoms.
I build a box containing ‘w with the subscript’ (details later); in the \wmat@false case this is used to make a vertical rule as high and deep as the box, with zero width. This will reserve the needed vertical space but produce no visible output. In the \wmat@true case the box is resized to have the same vertical dimensions as a plain ‘w’. This will be the last item that TeX will see and to which it will attach the _j^i items that follow.
Now how's the box built? I found that using \operatorname*{w}_2 places the subscript too far down below the ‘w’, so a different method is needed. I use the primitive TeX method for alignments. I open a \vtop, that is a box containing vertical material, with the reference point given by the top item inside it (it will be \mathrm{w}).
Inside the \vtop I build an \ialign (a wrapper around \halign with some initialization). This does a one column table, with no vertical space between rows (by \offinterlineskip) except the explicitly added \kern1pt. The top row contains, as said, \mathrm{w} in the needed size (via \mathpalette); the bottom row contains the subscript, always in \scriptscriptstyle.
The \vtop is assigned to a box register, so it is possible to access its dimensions (for typesetting the zero width rule in the \wmat@false case) or change them (for making it appear the same as ‘w’). Then the box is used in the \wmat@true case).
Information about \halign is found in the TeXbook or in TeX by Topic.
xparseis a relic of a previous attempt and is not needed here. I'll add some explanations. For the @, it is customary to use it in “private” command names, so as not to conflict with user level commands. – egreg Jan 30 '19 at 11:15\wmat@falseis defined by\newif\ifwmat@and makes the conditional return false when used. Similarly for\wmat@true. – egreg Feb 01 '19 at 11:47\wmatand\wmat@are different. The\begingroupand\endgrouptokens serve to bound the scope where the boxes are built. – egreg Feb 04 '19 at 21:04