This should block UA "Mozilla/4.0" ONLY?
No: it would block
Mozilla/4.0)
Mozilla/4a0)
like Mozilla/4a0)
blahblah blahblah (similar to Mozilla/4a0)
et cetera. Do you want a final ) or don't you? And, equally important, do you want quotation marks or don't you?
Incidentally, the [F] flag always implies [L]. The superfluous [L] won't do any harm, but it isn't needed.
RewriteCond %{HTTP_USER_AGENT} Mozilla\/4\.0
You don't need to escape forward-slashes in mod_rewrite. Slashes only need to be escaped if they have special meaning in your specific RegEx engine; this applies to a handful of Apache mods but not this one. The only special RegEx rule in mod_rewrite is that you have to escape literal spaces (and you can't use them line-finally, or the server will explode ;)).
Now, my personal opinion is that mod_rewrite is no place for pure UA blocks; it's a resource-intensive mod, so it's always the last resort. I put this kind of thing in mod_setenvif in conjunction with mod_authz-thingy, like "Deny from env=keep_out".
I once tried to work up some UA blocking based purely on the total length of the UA string, but there's always some ### exception.