Any creative work is protected by copyright from the moment it is fixed in some medium (e.g., written on a napkin, saved to a computer file). JavaScript source code is no exception.

Using GPL code doesn't make my code GPL. If I violate the GPL by failing to license my derivative work under the GPL, I lose my limited (GPL) license to the original work and the original copyright holder can sue me. I am in violation of copyright, but I can fix the violation by ceasing to use GPL materials, withdrawing my derivative work from publication and/or paying damages to the copyright holder as a court may decide--I don't automatically subject my code to the GPL.

The legitimacy of "browse-wrap" license agreements itself is doubtful, and many license agreements are full of possibly unenforceable clauses. At a glance, this license would appear to forbid one person from visiting the site on two different computers or with two web browsers, since each cache would likely contain a separate copy of the code, and though IANAL I doubt that would hold up in court. More broadly, courts have sometimes held that the first sale doctrine (i.e., if you buy something, the vendor can't prevent you from selling it to someone else if you like) applies even when license agreements attempt to restrict resale (not very relevant here), and reverse engineering is also often considered legal whether the copyright holder likes it or not. See <http://www.chillingeffects.org/reverse/faq.cgi>.

The fact that JavaScript is distributed in source form, however, makes it harder to defend whatever you do as reverse engineering rather than just copying or creating a derivative work. It seems to me that "black box" reverse engineering is nearly always protected, but "white box" reverse engineering treads a fine line, and in most cases trying to work with someone's JavaScript would be a very, very white box.

OTOH, it's very easy to glean techniques from reading the code and apply them in ways that are unlikely to be infringing and extremely unlikely to be provably infringing. There are only so many techniques, and if you're not outright copying an implementation it's very likely that any given idiom is already common knowledge and/or available from a more friendly source. This probably goes without saying, but anything that could be done by a script or rule, such as variable name substitution or changing indentation conventions, would only produce a derivative work and wouldn't be considered original. Not that that's the limit of derivative works. Almost anything that could reasonably be regarded as a transformation or modification of the original code would probably still be a derivative work, even if it requires some creativity. Analogously, there are only so many pleasing chord progressions, so you have a lot of latitude in composing your own songs, but you can't actually distribute your own recording of Sgt. Pepper without permission--even if you change some lines and add a verse.

Runtime "enhancements" like Greasemonkey scripts or Mac OS input manager hacks are (AFAICT) completely untested in court. It is my completely unprofessional opinion that the spirit of the first sale doctrine (since you can generally dispose of your legitimate copy of a copyrighted work as you see fit) and the general esteem in which black box reverse engineering is held (such enhancements often don't require extensive knowledge of the inner workings of the code they enhance) bode well for the legality of [some kinds of] enhancements--whether the copyright holder likes it or not.