I have to validate custom fields and also the primary text area using blogging platforms posts.

Any standard JavaScript based validator won't work with me because I have to do very custom validation.

EDIT: I determined that publish_save hook must do things i want. Should i create a custom module to make use of the hook. Otherwise where should i apply the validation.