Hooks are generally optional, unless you want to insert logic into the built-in workflow of the AddOnly Mode you're using. If you look at the Hooks tab of the LDAP Connector then you'll see a tree-view that shows you the top-to-bottom flow of logic.
That said, you do know that you can only add an entry once using AddOnly? If there already is an entry with that $dn value in the directory then the add operation will fail. If you want to be able to modify data as well, try Update mode. It combines a Lookup with AddOnly (if not found) and Modify (which is not a separate Mode).
And if you have not spent two hours working through the Getting Started tutorial exercises, then I recommend that highly!
https://www.ibm.com/docs/en/SSCQGF_7.2.0/com.ibm.IBMDI.doc_7.2/gettingstarted.pdf
I wrote it back for our first release and have kept it up-to-date since - at least, as long as IBM let me :)
/Eddie