It's ok to have the precommit hook modify code before committing it. For example, a development team might use the precommit hook to automatically reformat any code that is committed to automatically enforce that team coding conventions.
Based on the comment, I'm changing my answer - the svn manual specifically recommends AGAINST changing the contents of a commit because it can screw up the client side caching. Git works differently since the repository is local, but I guess the principle is the same.
As for the specific use case that you mentioned; it does seem a a little unconventional to use the precommit hook for that. Typically, the precommit hook is used for more general purposes. That said, if you're the only developer, you're free to use it however you like. Just don't forget that it's there.