I suggest that you consult with a criminal defense attorney with respect to the criminal matter that you are going to court for in a couple of weeks to give you some counsel with respect to the charge or charges against you. From what you have written, it appears that the security guard may have well been within his or her rights to make a citizen's arrest of you for violating a criminal statute.