Heat the oil in a skillet over medium-high heat. Add onions and cook until they soften, about 3 minutes. Stir in the garlic and cook for 2 minutes more.
Put half of the onion mixture into a food processor with the black beans, chipotle pepper, 2 tablespoons of the lime juice, cumin, water and salt. Puree until smooth. Set aside.
Add the corn to the skillet with the remaining onion mixture and cook for about 3 minutes. Remove from the heat and stir in the cilantro leaves.
In a small bowl mash the avocado with the remaining lime juice. In a medium bowl toss together the tomatoes, scallion and jalapeno, if using. Season tomato mixture with salt and pepper, to taste.
Spread the black bean dip into the bottom of an 8 by 8 glass baking or serving dish. Top with the corn mixture, spreading it out to form a single layer over the beans, repeat with the avocado, then the tomatoes. Top with cheese. Serve with baked chips.