Have a look at the image:
Object A is the one that moves, Object B is the one that moves around Object A. The green rectangle defines the region in which Object B moves around Object A.
You have to do two steps: Create a movement within a region with origin (0, 0) and set the boundaries relative to Object A's hotspot.
Let's say, the green rectangle represents a region of 200x300 pixel. The points P1 to P4 then are (0, 0), (199, 0), (0, 299), (199, 299). Object B has 7 private variables: nx, ny, ox, oy, cx, cy, t
cx and cy represent the current position within the region, nx and ny represent the new position that Object B has to reach, ox and oy the last position that was reached and t is the t-value for the lerp expression.
Some random starting position (you could as well just set the initial values of the PVs):
+ Start of layout
-> Object B: Set 'cx' to 80
-> Object B: Set 'cy' to 90
-> Object B: Set 'nx' to 80
-> Object B: Set 'ny' to 90
-> Object B: Set 'ox' to 80
-> Object B: Set 'oy' to 90
-> Object B: Set 'tx' to 1
If Object B reaches nx/ny set a new position (use 'Pick by evaluate'):
+ ObjectB: Pick by Round('cx') = 'nx' and Round('cy') = 'ny'
-> ObjectB: Set 't' to 0
-> ObjectB: Set 'ox' to 'nx'
-> ObjectB: Set 'oy' to 'ny'
-> ObjectB: Set 'nx' to Random(200)
-> ObjectB: Set 'ny' to Random(300)
While valid calculate the current position within the virtual region and make the region relative to Object A's position:
+ System: Always (every tick)
-> ObjectB: Add 0.5 * TimeDelta to 't'
-> ObjectB: Set 'cx' to Lerp('ox', 'nx', 't')
-> ObjectB: Set 'cy' to Lerp('oy', 'ny', 't')
-> ObjectB: Set position to ObjectA.X - 100 + 'cx', ObjectA.Y - 150 + 'cy'
This is just one movement style for Object B. You would have to adapt your own to this scheme. For example, the region is set centered around Object A's hotspot. You might want to have it not centered. Then calculate the "hotspot" of the region accordingly in the last action of the "always"-event. But the basics stay the same: "Move" the object within a virtual region. Then set the region relative to the first object's position.
Here is the .cap: http://www.mediafire.com/file/tkk496k08okk65q/relative.cap