If it's really the only base in reach, it will prevent a capture unless:
- they didn't already upped one ore more goons now circling some distance away from your base
- they have a CV nearby or otw
- they bring in a goon from a base very far away - people did fly goons over 4 sectors before...
The amount of time yo gain varies. Usually, barrack pop up after about 45mins, counting from the moment the first barracks went down (That's the main reason the actual downtime is often much less)
If the enmy starts to resupply his base, troops will be up again much faster.
If enemy city AND grunt training facility is destroyed, barracks will be down for a maximum time of 2 hours.