In a large skillet, heat 1 tablespoon olive oil and the garlic over medium-high heat. When the oil is hot but not smoking, add the shrimp and cook, stirring frequently, until they turn pink, about 4 minutes.
Remove the shrimp from the pan, reserving the garlic and oil. Chop the shrimp into pieces slightly larger than the beans. Toss the shrimp with the beans, adding the reserved oil and garlic.
In a serving bowl, toss the shrimp and beans with the remaining olive oil and the red onions. Strip the rosemary leaves from the stems and add to the beans. Toss, then add the vinegar and season with salt and pepper. Toss again, before adding the basil. Just before serving, toss the beans once more and adjust seasoning. Add more oil, salt, pepper, and balsamic vinegar, as desired.