Some of the functionality (auto expand filesystem on SD card) already exists inn FreeBSD install / boot scripts, IIRC.
The rest of the script is mostly about editing the file config.txt on the boot partition of the SD card. That file is valid for FreeBSD as well, AFAIK. But - the boot partition might not be mounted as default under FreeBSD.
And of course the script contains lots of Linuxisms (= commands that only work in Linux), so you would need to fix those in order for this script to be useful under FreeBSD.