My guess, then, is that your keyboard sends some lame-ass key combos instead of correctly emulating a key press.
Thus, releasing the F17 key doesn't send a key release as it should maybe?
However, could you try replacing the second line with:
*F7 Up:: Send {LWin Up}
On the other hand, if pressing and holding down the F17 key opens the Win menu before you release the key then the second line isn't the problem here.
'Scan code 54735' sounds like the scan code was reported in decimal which is highly unconventional and fills me with horror. In hex that's E0 5B which isn't the code for shift-F7 at all but ... *drum roll* ... the scan code for LWin!!! So now what, you remapped the key already (but it still isn't working right) and then remapped the LWin key to itself?! Better check out your registry or something by now.
If you want a clean remap section, run the following script by making it a .reg file and running that:
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
; The next line maps RWin <- CapsLock <- BackSpace
;"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,0e,00,3a,00,3a,00,5c,e0,00,00,00,00
; The next line remaps only CapsLock <- BackSpace
;"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,0e,00,3a,00,00,00,00,00
; The next line removes all scancode remappings
"Scancode Map"=-
[HKEY_CURRENT_USER\Keyboard Layout]
"Scancode Map"=-
; Numbers are LittleEndian (0x12345678 -> 78,56,34,12)
; ---------------------------------------------------------------------
; Bytes Meaning
; ---------------------------------------------------------------------
; 00 00 00 00 Version info (usually zero)
; 00 00 00 00 Flags (usually zero)
; 03 00 00 00 # of entries (# of mappings +1 for the terminator)
; 0e 00 3a 00 The CapsLock(3a) key now sends a BackSpace(0e) scancode
; 3a 00 5c e0 The RWin(e05c) key now sends a CapsLock(3a) scancode
; 00 00 00 00 Null terminator (always zero)
I suppose that KeyTweak can clean things up too.
Better yet, run regedit and browse to the keys mentioned in the script (both the LM and CU ones!) to see what's there before you change anything.