If you're using the on collision event you specify the type to check for collision with, so you could use the angle() expression. Just use the other object type instead of other.
Or if you make a family, call it other, and then use an event like this:
Sprite: on collision with other
That way you can use your expression exactly. Also this is the recommended way to handle collisions between two objects of the same type.