To not hardwire the TypeCode in your source code you have to find your item in the DB first, and then you can find out it's type in 2 different ways:
final ItemModel item = modelService.get(pk);
if (ProductModel._TYPECODE.equals(item.getItemtype()))
{
LOG.debug("ProductModel being edited");
}
//or
if (item instanceof ProductModel) {
LOG.debug("ProductModel being edited");
}
Although this might slow things down in an AfterSaveEvent listener, since this listener will be called for every object that is edited or created or deleted in your hybris server.