I see two potential issues in your code:
- processing properties.AfterProperties["User"] by parsing it. It would be better to use code like this (SPUserFieldValue)properties.ListItem.Fields["User"].GetFieldValue(properties.properties.AfterProperties["User"].ToString()). This way suggested by MSDN.
- Using SiteUsers indexer throws Exception when user is not found in the collection. You should wrap it by try ... catch statement. It can happen when user is used for the first time in your site collection.