Refactor: scheduler: best practices for is_op_dup()
Add a doxygen block, use bool instead of gboolean, use convenience functions
where appropriate, and improve comments and formatting.
Also, short-circuit if we find a duplicate -- no point in continuing the
search.