Condition "if" statement to change render engine modes
You don't want the curly braces around the string.

if context.scene.render.engine == 'CYCLES':
    layout.operator('render.set_internal')


Note that cycles and blender internal are not the only choices for render engine. It would be better to test if blender internal is the current engine.

if context.scene.render.engine != 'BLENDER_RENDER':
    layout.operator('render.set_internal')
else:
    layout.label(text='Blender render is active.')