Come, Holy Spirit, come;
Let thy bright beams arise;
Dispel the darkness from our minds,
And open all our eyes. (Original Trinity Hymnal, #254)
The purpose of the hymn before the sermon is not to give the congregation an opportunity to stand up before sitting for the sermon! At least that's not the primary purpose of the hymn.
The hymn before the sermon is called a "hymn of preparation"—more particularly, a "hymn of preparation for the Word of God preached." There is no biblical mandate to sing a hymn before a sermon. (There may be one in the morning service, but not in the evening service.) The biblical mandate is that we sing "psalms and hymns and spiritual songs" (Eph. 5:19; Col. 3:16). The number of them and the location of them in a given worship service is governed by the general principles that everything done in worship is to be done (1) "decently and in order" (1 Cor. 14:40), and (2) "for edification" (1 Cor. 14:26). At least in the morning service, it is "for edification" that we are reminded, and that we remind ourselves, that the reception of the Word of God preached is not to be taken lightly.
In the hymn of preparation, we often sing a hymn that reminds us of the truth of the Word of God, such as "Break Thou the Bread of Life, Dear Lord to Me" (which is not a Lord's Supper hymn, as is commonly thought). Or, we may sing a hymn that reminds us of the work of the Holy Spirit and its necessity as we sit at the feet of Christ as his Word is proclaimed, such as "Come, O Come, Thou Quick'ning Spirit," or "Come, Dearest Lord, Descend and Dwell." This latter emphasis should be the most common one in the hymn of preparation.
Especially before the sermon, it is important to realize that the Holy Spirit's work is absolutely necessary if the unconverted are to have their hearts changed under the preaching of the Word, and if individual Christians, families, and the whole congregation are to be transformed by that preaching. Jesus said that the Holy Spirit "will glory Me, for He will take of what is Mine and declare it to you" (John 16:14). It is this ministry of Christ by the Spirit, using the infallible Word of God, that we pray for and prepare for as we sing before the sermon.