Here's some half-assed debugging. Frame references from this submission file.
At 33015 it takes p2 input and stores it at $0367. Only B was pressed in this example:
07:F8E8:A5 10 LDA $0010 = #$40
07:F8EA:99 67 03 STA $0367,Y @ $0367 = #$40
Then at 33024 we get this:
07:E540:BC AB 04 LDY $04AB,X @ $04B0 = #$00
07:E543:B9 67 03 LDA $0367,Y @ $0367 = #$40
07:E546:A8 TAY
07:E547:D0 1D BNE $E566
Meaning it will only branch to $E566 if there was p2 input at frame 33015. That eventually leads to here:
06:A768:BD 63 04 LDA $0463,X @ $0468 = #$40
06:A76B:29 C0 AND #$C0
06:A76D:9D 63 04 STA $0463,X @ $0468 = #$40
Depending on what p2 input was at 33015, that will result in storing either #$40 or #$C0 in $0468. #$C0 = drac stays, #$40 = drac goes. And I stopped looking at that point.
Obviously, that's not a complete picture. but hopefully it's something to go on. Maybe a conditional (say, if $10 = specific p2 input) breakpoint on 07:F8E8 would turn up something else in another part of the game.
Edit: I set p2 input to hold BTULR and set an execute breakpoint on $F8E8 with the condition K==#07 && $10==#5B and came up with this list of frames where p2 input might do stuff. Most of them seem to cause desyncs, but I didn't bother looking into why.
6
281
328
4260
4996
5043
7557
13162
13896
13943
16198
17093
21061
21108
22582
27591
27638
29890
29936
31806
31852
32969
33015
Surely more possibilities past that point too, but I'll leave the rest to somebody else. I'm leaning slightly less towards 'debug feature' now.