When you impersonate, you need to recreate the SharePoint objects that you are working under the context of the impersonator. For example, if you are impersonating the System User using RunWithElevatedPrivileges, you can use the code below to recreate some of the SharePoint objects that you may need to manipulate:
public override void ItemAdding(SPItemEventProperties properties)
{
// Get the ids of the objects that we need to work with
Guid siteGuid = properties.SiteId;
Guid webGuid = properties.Web.ID;
Guid listGuid = properties.ListId;
int listItemId = properties.ListItemId;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
//Get Web and Site impersonated as SHAREPOINT\System
using (SPSite impersonatedSite = new SPSite(siteGuid))
using (SPWeb impersonatedWeb = impersonatedSite.OpenWeb(webGuid))
{
SPList impersonatedList = impersonatedWeb.Lists[listGuid];
SPListItem impersonatedListItem = impersonatedList.GetItemById(listItemId);
// Do your work here with the impersonated objects...
}
}
}
Edit: I realize that your are trying to update the AfterProperties collection and that the code above probably won't help you get at that object as the impersonated user. Can you modify the impersonated ListItem object instead of modifying the AfterPropeties collection? (I haven't written an ItemAdding event receiver, so I'm not certain of its limitations)