You cannot edit files from the Grub prompt (Grub can only read files, it doesn't have any write support). You need to boot Linux¹.
If you can't log in normally, you can completely bypass the normal boot process and start just a kernel and a shell. At the Grub prompt, press e to edit the boot sequence, add
init=/bin/bash to the end of the
linux=… line, and press Ctrl+X to boot. You'll get a root shell and nothing else. Run
mount -t proc proc /proc
mount -o remount,rw /
chsh -s /bin/zsh root to repair your user database.
Next, reboot with Alt+SysRq+U followed by Alt+SysRq+B, or boot normally with
mount -o remount,ro /
chsh without a user argument. That way, it validates the shell.
Tip: when you're changing some configuration, always keep a shell open and test the configuration. If you made a mistake, you'll still have a command line to repair it.
Tip: you can create a
toor account with UID 0 (so it's still root), with the same password as root, and where the shell remains
/bin/sh, so that you keep another way to log in if things break. Better yet, install a statically linked shell (
zsh-static) and use that as toor's login shell.
¹ Or you can use guestfs if the host is Linux.