Since the computer is attempting to boot most likely you have either a file system issue, a damaged system file, or perhaps a failing hard drive. It is also possible the power supply was damaged or weakened by the electrical issue. If you boot using Verbose Mode the computer will display the boot log on screen. When the boot process gets stuck look to see if there are any I/O errors listed which would indicated a bad hard drive.
Try booting the Apple Diagnostics.
Try booting into Internet Recovery Mode using Command + Option + R which will bypass the OS on the internal drive.
If you have an external macOS bootable drive you can also use that to test your iMac. Another option would be to boot from a live Linux USB drive such as Knoppix which will allow you test check and confirm a hard drive failure (I can provide instructions if you are interested).