Let's get ready for Halloween
JavaScript (ES6), 221 218 216 212 208 205 201 bytes

f=a=&gt;(c=d=L=0,e=1,s=[],[...a].map(a=&gt;a=='\n'?c=L=0:c++-(a!=' '&amp;&amp;(s[c]?e=0:(!L&amp;&amp;(d?d-1?e&amp;=c&gt;Q&gt;d-3:d=c&gt;Q&gt;2:d=1),L=s[Q=c]=a)))),e&amp;&amp;'Snickers0KitKat0Starburst0GummyBears0Twix'.split(0).indexOf(s.join``)+1)


Try it here.