You need to reference the file.
Try
set thePath to (((path to documents folder) as text) & "speed.txt")
tell application "System Events" to set modDate to modification date of file thePath
or
tell application "System Events" to set thePath to file (((path to documents folder) as text) & "speed.txt")
set modDate to modification date of thePath