Allright... you have a mess there mate...
* Line 3: you call purchase product twice there... first when someone touch the "Button_ovo10" and then on line 3. This logic is not logic .
* Consume product should be under line 6 condition. So simply once it is successful, then you consume it.
* Line 13 should not exist. It is being checked 60 times per second (if product is not restored/bought) for no reason. You should add those actions under observers.
But I doubt that this is the reason your app actually go black screened. I suggest removing and adding again the JS plugin in Intel XDK.