You have to shrink the filesystem first (which I think is resize2fs), then change the partition table. Otherwise some of the data will be abandoned outside the partition. As a general rule filesystems don't fill up the disk in order from the start of the partition. The resize filesystem process will gather up all the data that are part of existing files (thus needs to be saved) and place it into the new smaller space.
It is probably necessary to boot another OS (such as OpenWrt from a USB drive) so that the filesystem you are shrinking is not mounted.
An ext4 filesystem can be enlarged while it is mounted and active, but it must be unmounted to reduce the size.
I doubt that the script was ever designed or tested for the case of reducing the size. You should do that manually. Or even back up your configuration, reinstall OpenWrt from scratch, and use the script to resize (upward) to the size you want.
Install squashfs installation, then you will have router-like stable backup image and resize whatever you want. Like “normal” linux has init ramdisk that has basic tools to …. check disks and edit fstabs….
Ahh yes, ext4 x84 can not fsck root and will go rotten sooner or later.
usually you can simulate interactive question-answer based linux tool by feeding the answers like this:
echo “yn” | tool
which will feed y to first question, then n to 2nd question if questions expecting one character answer.
but in your case, shrinking will not work on a mounted file system as others already told. better boot a live linux and do it from there, or re-write the owrt factory image again to your disk.