You only need to put it in the .htaccess once, before any RewriteCond and RewriteRule lines.
Doesn’t necessarily have to be the first line, the following is perfectly acceptable
SetEnvIf REQUEST_URI htc$ no-gzip dont-vary
AddType text/x-component htc
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Here RewriteEngine On is on the 5th line of the .htaccess, and all RewriteCond and RewriteRule statements proceed it, so it’s fine