I am not able to reproduce the problem using the latest version of Dreamweaver Tools for Google.
Looking at the broken code, could it be possible that you cursor was inside of the javascript code when you added the Google Search?
What version of Dreamweaver tools for Google do you have installed?
What version of Dreamweaver?
What is you OS?