You didn't mention whether you will have checked bags. You will have to clear customs and immigration twice - once to enter Canada, and again (different terminal) to enter the US.
Without checked bags, 2 hours should be enough (assuming your arrival is on time and you are ticketed on the AA flight that day) - I have done it in 40 minutes before security got tightened. With checked bags, I'd go to 2 hours 45. Either way you should be okay.
If your BA flight is late you can probably talk your way into being reaccommodated on the AM AA flight if they don't do it automatically - it's all OneWorld, after all. This is almost a certainty if you check bags through SIN-ORD (which you should be able to do by showing both tickets at check-in in SIN).
It's a hike between the terminals so if you are a slow walker, add some time.