Wow, way to not cover all the rules of grappling at all. Which is exactly why its so complicated.
First of all, if the AoO hits your touch fails.
Then there are the rules of:
1)casting spells,
)moving people in the grapple,
3)using natural weapons,
4)regular weapons
5)actual damage dice...