Sounds like when you were trying to turn it off you activated something you didn't really want to. Like trying to set up a "Hard Reset" which would completely wipe the device.
But, it is possible that the whole thing is due to a bad app, virus or malware as well. If it has been hours and you are still on that same screen try restarting the tablet in "Safe Mode" and see if it will load.
To get into "Safe Mode" please do the following.
1. First turn off the tablet.
2. Next press and hold "Power" until you see the manufacturers logo on the screen, then release the power button.
3. "Quickly" press "Volume Down" and hold it for few seconds until you see the message "Safe mode: ON" or something similar.
4. If you wanted disable it, simply repeat the steps above, and you should see "Safe Mode: OFF" rather than on.