I may be able to help some. I am familiar with 6502 assembly coding, just not with the NES or SNES specifically.
From what I understand, reading the SNES controller isn't much different from reading the NES controller.
NES --> https://wiki.nesdev.com/w/index.php?title=Controller_reading_code
NES controller detection --> https://wiki.nesdev.com/w/index.php?title=Controller_detection
SNES --> https://wiki.nesdev.com/w/index.php?title=SNES_controller
SNES hardware ID codes --> http://problemkaputt.de/fullsnes.htm#snescontrollershardwareidcodes
The only difference is in the contents of the successive controller byte reads. On the NES, the 2nd and 3rd bytes would be all 1's which confirm it's an NES gamepad. On the SNES, the 2nd byte's upper nibble (bits 4-7) is part of the device ID info, where:
Byte1: Right, Left, Down, Up, Start, Select, B, A
Byte2: 8x 1's = #$FF if connected || 8x 0's = #$00 if not connected(?)
Byte3: 8x 1's = #$FF if connected || 8x 0's = #$00 if not connected(?)
Byte1: Right, Left, Down, Up, Start, Select, Y, B
Byte2: 4x 0's (high nibble), R, L, X, A
Byte3: 8x 1's = #$FF if connected || 8x 0's = #$00 if not connected
I believe something like this would work for detecting which gamepad is plugged in:
;Shift in 3 bytes of controller info
;NES or SNES?
;Check SNES ID
AND #$F0 ;ignore any button presses from A,X,L,R