The best thing to do is to try your best to turn off the power of your phone completely and let it sit for a while then turn it on. If your phone was overheating to that might be the reason of the freezeing for to many apps my have been open in the backround of your device. This takes up ram and causes the device to crash after awhile (depending on the phones performance). If you have these problems with your device anymore then take it to your local device repair shop.
I'm not quite sure if I understand what you mean but as far as I think I understood is that you put a pen on to a jack or your computer and it snapped then you pushed it further in to the jack? If I got that right then I suggest getting a screw and a screwdriver (if wanted) and screw the pen out of the jack. I had this problem but it wasn't a pen it was a headphone jack it snapped in the phone's headphone jack! Hope this works if this isn't the problem your having please explain to me what your problem is again?