I was just looking into implementing this, but it actually looks like you can already access environment variables in project.xml. They’re basically the same as defines. For instance, if your system has a FLEX_HOME environment variable defined, you can simply reference it in project.xml with ${FLEX_HOME}.
Another example… I have Sublime Text set up as my default editor by setting the EDITOR environment variable. When I add the following to my project.xml and build the project: