W3TC should not write over existing rules by default. It might however change the order since it inserts its own rules before the WordPress code.
If you run into this issue try adding # begin my code [yourcode] # end my code. Or disable Verify rewrite rules on the general settings page. Disabling will prevent W3TC of writing to the htaccess file.