Assuming the error is with the JS file, which my browser is blocking due to security concerns. Whatever you have in there is triggering some system of mine, which means it could also be triggering something on your site.
Generally speaking, specifying RewriteEngine On when it was already defined erases any previously configured directives. But when specifying it multiple times in a single file, it’s a bit unclear as to which rules will applied and which are not.
So you should only have one RewriteEngine On in your .htaccess file, above all the rewrite rules. And if you specify .htaccess rules in a subdirectory and want the rules from the parent directory to apply too, you should leave it out entirely.
The behavior of .htaccess files is that the server will look for .htaccess files in any directory in the path of the request it’s trying to execute.
That means that the .htaccess file in the root directory of your account will be applied to all websites, but the file in the directory example.com/htdocs will only be applied to the example.com website. It won’t apply to the website in the example.net/htdocs directory, because that’s a different path.
A website in the directory example.com/htdocs/blog/ will receive the rules in the .htaccess file in the root directory, the one in the example.com/htdocs/ and the example.com/htdocs/blog/ directories. If example.com and example.com/blog are different websites, then it makes sense to use RewriteEngine On in the blog directory to override any rules from the website of example.com.
If you have multiple domains/websites and they both need certain .htaccess rules, they will both need a .htaccess file.