How can I know the speed of an object inside a loop?
You need two things to make the Frame Offset work in a Object Transforms Input node:


The Animation of the object must be created using normal keyframes (fcurves)
You have to disable "Use Current Transforms" in the advanced node Settings. 


For future releases of AN it is already implemented that the Frame socket will only be available when Use Current Transforms is disabled.


If your animation is not made with keyframes but with this addon you will need to calculate the position of the object twice in each execution (for the current frame and the frame before). Then you have to calculate the distance between both points like you did in your example. You should create a subprogram (a Group in this case) in order to minimize the amount of nodes needed.