TRIPOLI, Libya — As the militiamen saw it, they had the best of intentions. They assaulted another militia at a seaside base here this week to rescue a woman who had been abducted. When the guns fell silent, briefly, the scene that unfolded felt as chaotic as Libya’s revolution these days — a government whose authority extends no further than its offices, militias whose swagger comes from guns far too plentiful and residents whose patience fades with every volley of gunfire that cracks at night.