The code has been recreated in all Super Mario All-Stars versions from scratch. In the Japanese version of SMB3 for the NES, when you are hurt and not Small Mario, you always return all the way back to Small Mario.
If you wear Kuribo's Shoe and get hit, you are also reverted to Small Mario.
When editing SMB3 for SMAS using SMB3 Workshop, it must use a x200 byte Super NES header. These patches for the Super Mario-All Stars version requires a header.
Super Mario All-Stars (WITH HEADER)
File Size: 2097664 (200200)
File MD5: B6CDB0CDD6699A5119BCAD86EFA8CBD7
File SHA-1: 2287F375F1D5311D37221F8248CEFE94DB0DC23C
File CRC32: 8F1A772C
Super Mario All-Stars + World (WITH HEADER)
File Size: 2621952 (280200)
File MD5: D458A0DE2F68182023C163DF9EC87119
File SHA-1: 28808FC81FA995789E6472DF54A999986A98DA77
File CRC32: F71F12E0
Super Mario Collection (WITH NO HEADER)
File Size: 2097152 (200000)
File MD5: 0B6D70D07523A8804CBBB94B154510A2
File SHA-1: BEE927B5FFE277EBD537B0872D2424EEAC37B8E3
File CRC32: 232BB5B8