AA flight use both Concourse D and Concourse E at MIA. While flights to/from SXM usually arrive/depart from Terminal D it is possible that on occasion they could be using Terminal E. If your flights to/from your home airport are on American they too could use either Terminal D or Terminal E. Those two Terminals are connected by a walkway inside the secure area which can be used on your flights TO the Caribbean. On your return flight, you'll have to clear US immigration & Customs after which you'll exit the secure area and clear the TSA Security Checkpoint before proceeding to the departure gate for your connecting flight.