Help Please! Creating and Assigning an aiStandardSurface via MEL


#1
 I am very new to MEL scripting (been in a class for about 3 weeks) and I am trying to write a looping script in which Maya will create and assign a new aiStandardSurface shader to each object selected. I would also like to include a conditional statement that tells Maya to only create a new aiStandardSurface shader if the object(s) selected have the default lambert1 assigned to them. If they have another type of material other than lambert1, Maya will skip this object and move onto the next. 
 I've been trying all day to figure this out, but to no avail, even after numerous Google searches, looking up the Maya documentation, and reading through the assigned textbook for the class. Embarrassingly, all I have done so far is created a string array variable to represent all objects selected and an if statement saying to warn the user if they have not selected anything. 
 I really want to learn, but a lot of this stuff is hard to grasp for me. 
 If anyone can help me, or at least guide me in the right direction, I'd be very grateful.