Checks current device. If device is below device #$08, it detects as a tape drive and skips saver. I use this for my C64 projects, when catering for both .D64 and .TAP versions of my games :) I hope this helps.
ldx $ba
cpx #$08 ;Device should be #$08+ in order to save
bcc skips ;Device below #$08
... do disk drive load / save code
skips:
rts ;Or jump to main program