Relating changes of a value in time to known events
You seem to be looking for a clustering mechanism for your event sequence data based on a dissimilarity/ distance measure. 
I would recommend you to explore TraMineR package.