Qaddaffi admitted Libyan reposnibility in 2003, probably to attempt to play nice after seeing what happened to Saddam.
I think most credible analysis puts Iran behind that attack. Obviously, a state actor taking credit for an act of terror like TWA 800 would be akin to declaring war.