As to the differences between Embassy's and consulate's there is a weath information on the web. Help yourselves.
It has been stated before; The security provided by the http://www.mcesg.marines.mil/ is limited to internal security. Making sure doors are locked, safes secured, paper not left on desks in the open, etc.
Read the mission statement on the home page and try to understand.
Embassy's and consulate's are not armed enclaves and were never intended to be. That is not the mission of the Dept of State.
When a host country cannot or will not provide adequate security embassy's can and will be closed.
I can only guess at why we had an open embassy in Tripoli and a consulate in Bengazi but I would assume it was because the State Dept thought it was in our best national interests to maintain direct, daily interactions with the local populations.