Would my paper get rejected if the related work section takes up too many pages, and what would the optimal maximum length for this section be? I have recently submitted my paper to the journal of IEEE Access. They wanted me to only expand the related work section, so I have additionally included dozens of papers, most of which were suggested by them, into this section and will resubmit the paper in the following weeks. However, that section takes up three and a half pages now.

Would my paper get rejected because the related work section takes up too much space? Or, at least would it make a bad impression on reviewers and, if accepted and published, on prospective readers? If you suggest that I shorten this section, what would be the optimal maximum length for the literature survey section for a prestigious journal? 

I ask this, because the related work section of most of the papers I've come across in this journal takes up one page at most in general. As I said, when the reviewers asked me to include all the papers they recommended, the related work section had to be much longer.

FYI, this journal has a specific policy such that you can resubmit your paper only once after the original submission. That is, if they reject your paper one more time, no more resubmissions will be allowed under the name of revision.
If the papers were suggested by the reviewers, there are high chances that those papers were from "reviewers" and they wanted to increase their cite count.

In my experience (non IEEE Access), I cited those papers and the paper got accepted. No need to cite additional papers (OTHER THAN THOSE OFFERED BY THE REVIEWERS). I think because the contribution you made was based on your prior study of literature and it should suffice. 

If you think that few papers SUGGESTED BY THE REVIEWERS are not under the scope of your research, simply explain politely that "We found paper XYZ to be out-of-scope of our current research and could not fit into our paper. However, paper XYZ-2 did shared some interesting ideas. We have included a detailed discussion on this in Section ABC"... and