I've just noticed you're on R14 - I'm on R18, but I don't know if this could make your Python act differently.
I don't get this - are you checking for actual errors in the console ?
empty lines don't seem to cause me any errors - look in console
doc.SearchObject is designed to look for objects by name, if you really must have multiple objects with the same name you can use
obj = doc.GetFirstObject()
obj = doc.GetFirstObject().GetDown().GetNext() etc
where down and next have same meanings as per iteration nodes (but this could break if you move stuff around). You can also link to an object in the hierarchy, and use down, next from there.
Although I don't use it, I think op refers to the object a Python tag is on in the hierarchy ie if instead of using a XP Python node, you had all your code in a Python tag on a cube, op would be that cube.
if the node input ports had different variable names, should be OK. I think I'd find it confusing having a lot of objects with the same name. I use C4D's renaming function and AutoRename from here to bulk name stuff eg thing.01, thing.02, thing.03 etc.
The code thing is one of the buttons alongside Bold etc. Will read other questions and get back to you later.