That's a terrible workaround.
Copying its text to the clipboard when double-clicked is the default behaviour of a Static control. Therefore you just need to override the default behaviour, the same way that you can for any other message.
If a monitor function uses Return without any parameters, or it specifies a blank value such as "" (or it never uses Return at all), the incoming message goes on to be processed normally when the function finishes. The same thing happens if the function Exits or causes a runtime error such as running a nonexistent file. By contrast, returning an integer causes it to be sent immediately as a reply; that is, the program does not process the message any further. For example, a function monitoring WM_LBUTTONDOWN (0x201) may return an integer to prevent the target window from being notified that a mouse click has occurred. In many cases (such as a message arriving via PostMessage), it does not matter which integer is returned; but if in doubt, 0 is usually safest.
OnMessage(0x203, "OnLButtonDblClk")
OnLButtonDblClk(wParam, lParam, msg, hwnd) {
WinGetClass class, ahk_id %hwnd%
if (class = "Static") {
if !A_Gui
return 0 ; Just prevent Clipboard change.
; Send a WM_COMMAND message to the Gui to trigger the control's g-label.
Gui +LastFound
id := DllCall("GetDlgCtrlID", "ptr", hwnd) ; Requires AutoHotkey v1.1.
static STN_DBLCLK := 1
PostMessage 0x111, id | (STN_DBLCLK << 16), hwnd
; Return a value to prevent the default handling of this message.
return 0
}
}