|I can't really help on the assembly programming side of things, but I own a it8212f based card and I can say a few things about.|
1. The flash chip on my card is also larger than the firmware, the rest of the memory was padded with 0xFF originally. I always left the firmware unmodified, except for padding it at the end to match the capacity of the the flash chip. It has always worked fine this way.
2. It's probably not an issue for UEFI, but on my regular bios certain options(like USB legacy mode) cause the card to cease to function at all due to lack memory.
You say that it worked initially with the stock raid bios, at that it doesn't work with the flashed atapi bios, but have you tried it with the latest raid bios? I understand you want the atapi mode, but it could help to know if it's just newer bioses that don't work or if it's just the atapi versions.
I have a copy of atapi 220.127.116.11 if you want it, I also have a couple of older raid versions. If you are interested send me a PM with an email address.
One more thing I forgot to mention is that I always found the things worked better disconnecting all disks for the flash and leaving the disks disconnected for the first cold boot. I know it sound strange but it seems to avoid the "disk not ready" errors.