I assume the tricky part is determining when the mode is left, since -lockworks a bit weird for user modes. @Screwtapello had a suggestion you can try on the linked thread by using the NormalIdle hook. For entering the user mode you can always add the highlighter using the ModeChange hook, maybe with an -override switch so that it doesn’t complain when the mode is re-entered.
A minor maintainability hint: if you make the second hook do unset-face window PrimarySelection then you don’t have to modify this hook when you switch to a different colour scheme that uses a different default colour.