Yes, the code can be built for Flex 2. Right now we don't actively distribute binary versions of it that way, but there is nothing about the code specific to flex 3 that would cause issues.
Won't there be issues with the custom metadata in Flex 2? I think you would need to do some kind of -keep-as3-metadata type thing for it to work, and I don't think that was supported in Flex 2.
You are right, of course. In Flex 3, when we state the metadata we need to preserve in a library project, it is automatically preserved in a flex project that uses that library.
However, in Flex 2, that wasn't the case. Good news is that it can still work with Flex 2. However, either in your flex config xml files, or in the project itself in builder, you will need to specify the metadata that needs to be preserved.
Here are the pieces of metadata you need to preserve in flex 2. You will do this by adding an extra compiler argument to your project in the project's properties:
-keep-s3-metadata= RunWith,BeforeClass,AfterClass,Before,After,Suite,Test,TestCase,Ignore,Filter,Sort,Theory ,DataPoint,DataPoints,ArrayElementType