Why do you have to not be in edt mode to delete materials or shape keys?
Yes there is a small reason behind this. This happens because when we remove a shape-key object's vertex data is changed to the current shape-key state which have to be rcalculated so for removing lags or software crash. That's why you can't  delete shape key in edit mode. Whereas in concern to the materials the can be applied, removed and added in edit mode. If you are unable to do this it means that you are not currently having an active material slot available you will have to add and leave a material slot empty on order to create materials and make a material in order to apply then on your mesh.