How to write a script to copy one key frame at the time from one armature to another?
Here's an old brute force script of mine to convert euler kfps to quaternion.  Note it will add full wxyz keyframes for any frame that has any x, y or z euler rot keyframe point.

import bpy
context = bpy.context
scene = context.scene
arm_obj = context.active_object
#arm_obj = scene.objects.get("ArmatureName") # None if doesn't exist
# all pose bones
for pb in arm_obj.pose.bones:
    if pb.rotation_mode == 'QUATERNION':
        continue
    frames = []
    fcurves = []
    dp = 'pose.bones["%s"].rotation_euler' % pb.name
    for index in [0, 1, 2]:
        # search for rotation euler kfps
        fc = arm_obj.animation_data.action.fcurves.find(dp, index=index)
        # make a list of frames that have euler rot keyframes
        if fc:
            frames.extend([kfp.co[0] for kfp in fc.keyframe_points])
            fcurves.append(fc)
    # run thru and keyframe in 
    for f in set(frames):
        scene.frame_set(f)
        pb.rotation_quaternion = pb.matrix_channel.to_quaternion()
        pb.keyframe_insert("rotation_quaternion", frame=f)

    # clean up by removing euler fcurves (will coexist ok)
    '''
    for fc in fcurves:
        arm_obj.animation_data.fcurves.remove(fc)
    pb.rotation_mode = 'QUATERNION'
    '''