All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
The narration referred to in the question is reported by At-Tabaraani. Ibn 'Abbaas narrated that the Prophet said: "If any of you stands for the prayer, he should not close his eyes." So the majority of the scholars provide this as evidence that it is disliked to close the eyes throughout the prayer, even in the prostrating position.
Qalyoobi and 'Umayrah from the Shaafi'ee school said: 'It is desirable for a person to open his eyes when prostrating so that they [the eyes] would perform the prostration with him, and the same thing applies when bowing'.
In fact the narration that the majority of the scholars provided for the dislikeability of closing the eyes is a weak narration, and it is not correct to provide it as evidence, as in the chain of narrators there is Layth Ibn Abu Saleem and he is considered as a weak narrator. It is for this reason that a group of scholars are of the view that it is not dislikeable to close the eyes during the prayer.
Imaam An-Nawawi said: 'The preferable opinion is that it is not dislikeable to close the eyes during the prayer if one does not fear any harm as closing the eyes makes a person feel more humble and submissive, and by doing so one prevents looking around and therefore he is less distracted.'
It appears that this second opinion is the closest to the truth.
Allaah knows best.