That is relatively straightforward....
<event name_arme="GM End Mission" id_arme="44e94d80-61d4-4421-adcb-e6c213409b90">
<if_gm_key keyText="Q" />
<end_mission />
</event>
This is set so that when the GM presses Q, the mission will end. You can change the GM key to anything you want.The code was created in the mission editor and copied directly from there. To add it to a mission, just copy and paste it into the script.