Not sure if this is what you mean, but the IMaterial object has GetShader/SetShader methods already. http://gmodwiki.com/mirror/wiki.garrysmod.com/index43e7.html?title=IMaterial...
Ah, thanks :) Wasn't able to find it on a mirror myself.