Thoughts generally don’t count in Eastern philosophies at all. I don’t think that science can prove anything more than that thoughts arise or anything beyond that one becomes aware of them. There may be electrical signals in the body but it seems to me those same signals could correlate to the receiving of thoughts as much as they could to the producing of them. Many arising thoughts I consider non sequitur and so no, I do not think that there was some internal process that cooked a random and potentially dangerous thought up. A compulsion to do something that you wouldn’t normally consider or methodically think to. Either way, the thought is not you, it arises and it falls away, what counts is not an impermanent and sudden arising in the mind but only what one does.
Some people talk about how thoughts are creating reality but how do they know that? It could equally be that thoughts are notifying you about your coming reality as you get setup and put together for it.