I must have missed what you wanted to do,
i thought you just wanted a popup mode toggle if there is no n in the modes then have the popup say +n and if there is n in the modes then have the popup set mode -n.
in that case you would just have to check:
if (n isincs $gettok($chan(#).mode,1,32))
i should have said that in my example above. but i missed out the $gettok from it.
if you searched the string for +n there are many times when it would be false, say the modes were +inst.
//if (+n isincs +inst) { echo -a this will never happen }