Well, each object in a Rhino document is stored in a table called the object table, it is attributed a unique object ID (GUID) so it can be found. Rhinoscriptsyntax methods mostly work on object ID’s, but behind the scenes they call RhinoCommon methods that need to get the “Rhino object” associated with the object id by looking it up in the object table.
This is what rs.coercerhinoobject() does, it is just a utility function to try and get the Rhino object from the ID by looking it up in the object table. Rhino objects have attributes, among them layer, display color, print width etc. These attributes can be changed as needed.
So, why would the second script be faster? The first script calls up 4 rhinoscriptsyntax methods for each object, each method will first use coercerhinoobject() behind the scenes to find the Rhino object based on its ID, modify its attributes and then write the changes back to the document. That means 4 times a lookup and 4 times a write back for each object.
The second script only looks up each object once, does all the attribute changes in RhinoCommon and then writes back the four attribute changes at once. So, it uses only 25% of the time spent by the first script looking up and writing back.
Each lookup and write operation takes a small amount of time. For a couple of objects you will not see the difference, for a couple of thousand you probably will.