Wiping cache and dalvik alone works no problem. It is the restore function that causes the no boot issue.Humm.. I have this same problem for a while. Did you try just holding power + volume down for 5-10sec after it stuck at the end of app optimizing? It should reboot and start fine.
You never had this issue after a dalvik cache wipe?
And the use of mke2fs is perfect. It's related to the kernel, mk2fs allows to modify ext2 ext3 ext4 in one tool, so it saves a bit of space. For f2fs formatting, mkfs.f2fs is used.