I thought I'd share one of my first macros I've tried with Keyboard Maestro. Basically, it runs a program when Xcode is activated/deactivated to enable and disable the function keys. The method here uses a program created by Nelson Chen. I forked his project and modified it slightly for my purposes (mostly by adding an option to toggle when the program is invoked with no arguments).
The project can be downloaded here -> https://github.com/mscreations/fntoggle
and if you would prefer an Applescript version (I ditched this method because I didn't like how the System Preferences icon would bounce on the dock):
Hope someone finds this useful.