Is there a way to make an operator know if the context viewport is in ortho or perspective mode?
Yes, you can check is_perspective.

You can get the perspective of the current context (provided the current context is a 3D view) with bpy.context.space_data.region_3d.is_perspective.

For example, running this in the text editor will print Perspective or Ortho to the terminal for each 3D view.

import bpy

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        for space in area.spaces:
            if space.type == 'VIEW_3D':
                if space.region_3d.is_perspective:
                    print("Perspective")
                else:
                    print("Ortho")