You don't change UDFs, that's the beauty of them. Make sure to read the second link I provided "How to use UDFs".

Basically it should come down to a if statement...
 Code:
If SessionType="RDP"
  ;Do RDP Stuff
Endif

;Copy UDF at bottom of your script


or if using Glenn's example
 Code:
; Con=Direct Console, RDP=Terminal Server, or ICA=Citrix
$ConnType = Left(%SESSIONNAME%, 3)
if $ConnType="RDP"
  ;do RDP Stuff
endif
_________________________
(... better days ahead)