When my wife was the Executive Director of a Synagogue (Beth El of Montgomery County) in MD, USA, they installed a security system. It was quite simple, but effective. There was a bullet proof glass window in the office that surveyed the entrance lobby with an intercom. The inner doors were controlled by a security switch so that they remained locked unless someone actively depressed a red button inside the office. This was installed to primarily prevent homeless people wandering in, some of whom were on drugs and were unstable.
ln one case a man who was dishevelled and dirty came in and wanted to enter the synagogue. My wife called the rabbi and he went out to talk to him, it turned out he was Jewish and wanted to sit in the synagogue. They let him clean up and gave him a meal and he came back a few times. But, usually they were begging and they had to institute a policy of not giving money, otherwise all the beggars in DC would get on the Metro and come out to get a hand-out. The problem with this kind of vetting is that it breaks down when there are many people entering at once, as on Shabbat.
One of the other parts of the security system was of course a series of motion detectors inside the shool. Unfortunately this often went off in the middle of the night, and my wife was afraid to go by herself, so I had to accompany her, and meet the police outside and then go in with them. Fortunately they were all false alarms. The company said the problem was that the system was so sensitive that it would pick up the movement of mice or cockroaches. I was glad when she left that job.
About having guards, as Pres. Trump suggests, apart from the cost, it is also not very effective. A determined man with a gun can take a guard by surprise and cut him down, although this would act as a warning to those inside. Even having a lay person patrolling at the door is a good thing, because when a potential attacker sees someone patrolling outside, he doesn’t know if they have a gun or not and might move somewhere else, to choose a softer target. This is what happened with the terrorist who blew himself up in the Park Hotel in Netanya in 2002. At first his driver took him to Tel Aviv, but all the hotels there had guards, so he said let’s go to Netanya, and they saw the Park Hotel did not have a guard on duty, actually he was sitting at the back of the lobby, and the terrorist walked in and blew himself up in the dining room. There are no guarantees against such immoral craziness.