EDIT: Apparently I wasn't very clear since I linked the question this supposedly duplicates in the first sentence so I could ask about the robustness of that solution.. I want to know if the method described there is something I can count on to be robust across various engines XeLatex, pdflatex, lualatex and something that won't break by running out of the math alphabets.
I should have been more clear and simply said: Is the method used in question the right way to do it in a package that might be used under multiple different engines.
I want to do the same thing described in this question except for the \ndivides symbol (both \centernot and \nmid options look weird to me for \nmid) but I'm doing this in a package that I want to be compatible with XeLaTeX and LuaLaTeX font selection using unicode-math. Is using \DeclareFontShape the right way to do things universally? Do I need to break this up into cases (different code for the different engines) or what?
I'd like to do things the appropriate way so it won't break with future changes to how font-selection is done or cause people to run out of math alphabets.