In your code snippet, it's unclear if $ItemID is actually assigned a value?
In any case, there's really no reason at all to do a two-way relationship that you need to keep in sync via automated updates. Items referenced by a another item via a relationship will always show those items under the "Related items" section at the bottom of the item. For example, with relationship field in the company app, you can see the related company under related items on the primary contact item.
You can access the items the references a given item using this API operation: https://developers.podio.com/doc/items/get-item-references-22439