But what you replied with is math too, and actually it's basically the the same as what I referenced.
Velocity is a vector. Or basically it has a x and y value. The magnitude of a vector is it's length which can be calculated with the Pythagorean theorem:
sqrt(sprite.physics.velocityX^2 + sprite.physics.velocityY^2)
Or just use the distance expression, which does the same thing:
distance(0, 0, sprite.physics.velocityX, sprite.physics.velocityY)
In your example the "sqr" means the value is squared so that would be this:
sprite.physics.velocityX^2 + sprite.physics.velocityY^2
distance(0, 0, sprite.physics.velocityX, sprite.physics.velocityY)^2
just repace "obj.velocity.sqrmagnitude" with one of those.