Just in case you haven't found a working solution...
Skrommel
;MoveSameName.ahk
; Moves files with the same name to a common folder
;Skrommel @ 2009
from=C:\Dir1
to=C:\Dir2
Loop,%from%\*.*,0,0
{
SplitPath,A_LoopFileLongPath,name,dir,ext,name_no_ext,drive
MsgBOx,Moving`n %A_LoopFileLongPath%`nto`n %to%\%name_no_ext%\%name%
FileCreateDir,%to%\%name_no_ext%
FileMove,%A_LoopFileLongPath%,%to%\%name_no_ext%\%name%
}