Rotate object in python in BGE?
Removing the then inside of the if statements and replacing the - and + with -= and +=:

def mimic_process():
    if own_rotation_x &gt; mimic_rotation_x:
        own.worldOrientation.to_euler.x -= 1
    elif own_rotation_x &lt; mimic_rotation_x:
        own.worldOrientation.to_euler.x += 1