Did you tried working with our Unity samples?
Unity hangs because of the infinite loops or when loading large files. You could check this one answer in Unity Answer's.
You could futher test your project, by loading an empty scene with someEmpty script, OR just add a Debug.Log statement in your script. Does it hang often now? If not, then you need to test your scripts, which you think could hang Unity.
Let me know, if it helps.
Thanks & Regards,
Appwarp Support Team.