Hello,
is_operator_online() would work just as you have described. However, this id (or 'code') that is passed into the function is a database id, which is not something that is easily exposed to a user interface.
On that admin panel under "Operators -> [username] -> General", there is a code field there. I have never tried to use it so I don't know how it works. Not sure what your use case is, but it may be worth plugging into that such that you rely on a user defined value rather than a database id.