Learning IR codes is one of the simpliest things you can do on a remote (Step 4 from the Program menu). If you can do macro programming as stated above, learning should be piece of cake.
As far as IF / Else..............see if this helps
[Link: remotecentral.com]