OK, here's the complete disassembly with explanation:
$03/DB5F A2 00 00 LDX #$0000 ;Load Character slot 1
$03/DB62 BD 03 20 LDA $2003,x[$7E:2003] ;Check status byte 1
$03/DB65 10 0F BPL $0F [$DB76] ;If not dead, skip ahead
$03/DB67 29 7F AND #$7F
$03/DB69 9D 03 20 STA $2003,x[$7E:2003] ;Remove Dead status
$03/DB6C BD 07 20 LDA $2007,x[$7E:2007]
$03/DB6F 18 CLC
$03/DB70 7D 02 20 ADC $2002,x[$7E:2002]
$03/DB73 9D 07 20 STA $2007,x[$7E:2007] ;Add amount of current level to current HP
$03/DB76 C2 20 REP #$20
$03/DB78 8A TXA
$03/DB79 18 CLC
$03/DB7A 69 80 00 ADC #$0080
$03/DB7D AA TAX
$03/DB7E E2 20 SEP #$20
$03/DB80 E0 80 02 CPX #$0280
$03/DB83 D0 DD BNE $DD [$DB62] ;Perform the previous steps on the remaining four Character slots
$03/DB85 A9 40 LDA #$40
$03/DB87 8D EB 29 STA $29EB [$7E:29EB] ;This loads 40 into that mysterious "bitmask of status ailments set to expire"
$03/DB8A 8D ED 29 STA $29ED [$7E:29ED] ;portion of RAM. I don't know exactly what other purposes this area has, but I
$03/DB8D 8D EF 29 STA $29EF [$7E:29EF] ;do know that live characters have a 40 in their respective slots here, and
$03/DB90 8D F1 29 STA $29F1 [$7E:29F1] ;dead ones have a 00. Interestingly enough, without adding 40 here, the
$03/DB93 8D F3 29 STA $29F3 [$7E:29F3] ;character will come back to life, but will take no turns in battle.
$03/DB96 4C 88 D3 JMP $D388 [$03:D388] ;Jump to damage determination routine (for target monster(s)).
You'll notice that, at the end, the Phoenix routine simply jumps to the normal damage spell routine (used for fire/ice/lit, etc.). One could, in theory, change this jump to any other spell effect, or could change the element from fire to something else (this is stored in the normal spell elemental data). Of course, doing any of that would alter what we've come to know as Phoenix.
There's also a patch and save attached, for those who want to see the whole thing in action. The patch should be applied to a FF2US v1.1 ROM. It will only turn Odin into Phoenix, so this can be patched in to any hack seamlessly.
I was thinking - story-wise, King Baron could join your party as Phoenix just as sensibly as he could join your party as Odin. After all, he has died and is sort-of coming back to life. I mean, Phoenix is a bird, not a guy, but Leviatan is a sea serpent and Bahamut is a dragon, but they both look like people when you talk to them, so obviously the game's mythology is cool with this idea.
Anyway, have fun!