Map Right Command Key to Escape?
You can download Ukelele. It is an free keyboard layout editor, and you can make a new layout for your keyboard where simple redefine the keys. In the package are sample keyboards and a manual/tutorial too.