First you define how many units will make up one mile (UnitsPerMile#).
Then you can roughly determine an objects speed by using:
START LOOP
...
x# = OldX# - object position x(obj)
y# = OldY# - object position y(obj)
z# = OldZ# - object position z(obj)
Speed# = sqrt(x#*x# + y#*y# + z#*z#) / UnitsPerMile#
OldX# = object position x(obj)
OldY# = object position y(obj)
OldZ# = object position z(obj)
...
END LOOP
[edit] There are variations of course. You can leave out the y# (-> sqrt(x#*x# + z#*z#) / UnitsPerMile#), or you can use vectors to make it faster, etc. But I think this is the most basic method.
Good luck!
Sven B