At this late stage in the election campaign the candidates’ protection has been increased – generally – to “near-presidential level”. That means that they will start “almost” treating each candidate “as if he or she were already the president”. It doesn’t mean that they will go to the extraordinary lengths that are employed for presidential trips outside the White House, with security checking along travel routes, setting snipers on building roofs, welding down manhole covers in the street, etc. – and screening every person expected or likely to meet with him – but they won’t be far behind.
What that means in practice is that it is unlikely to the point of improbability that you would be in a room with either of the candidates and have anything resembling a weapon on your person. If you had been unwilling to leave it at the door upon entering, then you would have simply been denied access to the room.
On the other hand, should you be physically assaulted in some way by a candidate receiving Secret Service protection and should you retaliate in some perceived one-time non-lethal response, such as a punch in the nose, then it can be assumed that you would be separated and barred from further contact with the candidate, possibly arrested, and silently applauded by all right-thinking humans.
Whether that would save you from prosecution or not is certainly problematic. However, in case it happens you should certainly opt for a jury trial.