A superb post-tea burst by veteran Jack Brooks gave Somerset the edge over Warwickshire in an engrossing, high-pressure LV= Insurance County Championship clash at Edgbaston.