Cornelius a Lapide understood the verse to mean the day of judgement.
Ver. 3.—And if I go away, &c. If, i.e., when, I go away into heaven and there prepare a place for you and all your successors, that is, for all the elect, by giving them through the ages the Holy Ghost, and His grace by which He may prepare them for celestial glory; when, I say, this has been accomplished, then I will come again in the day of judgment, and receive you all to Myself, and crown you with a worthy reward in heaven.
St. Thomas Aquinas understood it in both ways.
1860 The glorification of Christ was completed by his ascension. And so as soon as he ascended, he sent the Holy Spirit to his disciples. He told them ahead of time that he would physically leave them, saying, if I go and prepare a place for you. And then he promised them a spiritual return, saying, I will come again. I will come at the end of the world: “Then Jesus … will come in the same way as you saw him go into heaven” (Acts 1:2). And will take you, glorified in soul and body, to myself: “We shall be caught up together with them in the clouds to meet the Lord in the air” (1 Thess 4:17).
1861 Will Christ wait until the end of the world before he takes the spirits of the apostles? It is the opinion of the Greeks that the saints will not go to paradise until the day of judgment. But if this were true, the desire of the Apostle (Phil 1:23) to be with Christ would be futile. Therefore, one should say that immediately after the house where we dwell here is overthrown, our souls are with Christ. And so the statement, I will come again and will take you to myself, can be understood as that spiritual coming with which Christ always visits the Church of the faithful and vivifies each of the faithful at death. Then the meaning is: I will come again, to the Church, spiritually and continuously, and will take you to myself, that is, I will strengthen you in faith and love for me: “My beloved has gone down to his garden, to the beds of spices,” that is, to the community of the saints, “to feed in the garden,” that is, to delight in their virtues, “and to gather lilies,” to draw pure souls to himself when he gives life to the saints at death [Song 6:1].