The church allows all to attend meetings, even nonmembers and ex members. What if a non, ex, or member began outright speaking against the church and its doctrines, to the point that they were a heckler? Would they be banned from the building? Would legal action be taken? Just curious..
As you noted the scriptures are clear that we are to allow non-members and even excommunicated members to attend. This is found in D&C 46:5-6:
5 And again I say unto you, ye shall not cast any out of your sacrament meetings who are earnestly seeking the kingdom—I speak this concerning those who are not of the church.
The condition of admittance is that the person is earnestly seeking after the kingdom. That can sometimes be hard to tell. In practice, as long as the person is reasonably well behaved, they can stay.
However if someone heckles, or attacks, or actively tries to lead others astray, then they show they are not “earnestly seeking after the kingdom”, and the local leader can take steps.
The local leader should follow the guidance of the Spirit and the local laws in dealing with such disruptive people. This can range from being asked to stop and/or leave, to court orders, police, and other legal processes.