It is one of those "it depends" things. Course specific and also specific to how you want to win with either a long range move or a real sprint. At Wells my approach is normally to attack somewhere on the back stretch after someone takes a pull and then pulls off.
In general the gap is almost exactly how much time you can mess around before it gets dangerous, I try to plot out how much distance that is on a course. Wells is about 1:50 per lap, 30 seconds means you have the finish straight to play around without too much danger. One thing I tend to do on any course where I can see the field is find the gap myself by starting to count (or watch the garmin timer) when I pass a point and then checking when the field passes that same point.
But if the field was as close as it sounds then I don't think you had a lot of time, your best bet is to try a longer distance attack if you aren't in a good position to sprint. Another tactic is to try and shuffle up the breakaway rotation just a bit so that the guy finishes his pull at the most opportune spot for you to attack (that can also mean shuffling so he pulls on the finish straight)