For multiline remaps, you need to begin writing the code you want to execute starting on a new line after the key you want to remap.
So:
F5::
WinActivate, ahk_class Notepad
WinGetTitle, Title, A
Controlsend,,{F5}, %Title%
return
CLICK HERE to find out more related problems solutions.