Why is some code being skipped in the BGE?
After some time i now found the solution.
The problem was that this code was executed in a Try execept function. thats why i got no error (my bad). But the actual problem was that the object i was looking for wasn't in the list. this is caused beacause the object was parented to an object on an active layer but the object itself was on an inactive layer. I searched in both lists (scene.objectsInactive and scene.objects) but the object wasn't in any of them. 

fazit: you shouldn't parent objects on different layer when one of those layer is Inactive.