Wall Street firm Morgan Stanley has agreed to pay $102 million to institutional investors, distressed borrowers and the Commonwealth of Massachusetts to settle dispute over the firm’s role in the financing and securitization of subprime loans made in the Bay State. The agreement was reached with State Attorney General Martha Coakley as part of a continuing