The idiot, as you call him, was caught up in the emotion of it all probably reinforced by online contacts, I suspect, but that answer will come out at some point. Do I believe that he would have done this after thinking rationally about doing this. What the impact on his family in its community would be? If he could actually kill someone? No.
What steps could have anticipated and averted this tragedy? I don't pretend to have the answers to individual questions like this one but I am sure enforcement agencies around the world are examining them. What do Boston and its agencies do now to prepare for the Boston marathon as a result of the recent attack? Perhaps I am naive but I do believe that when such tragedies occur, the attending enforcement agencies at all levels do an in-depth review and try to see what could have been done differently to achieve a better result. It is very painful for those who are dedicated and committed to protecting society to go through terrible tragedies like this.