You place it in your portal and execute this command in loop:
Code:
execute as @e[tag=ToLoc1] as @a at @s if block ~ ~-1 ~ obsidian run tp @s X Y Z
You can change the tag of the entity (ToLoc1) without forgot to change in the second command. You can also change "obsidian" by the block of your portal.
To do the return portal, do the same system but with an entity with an other tag than the first.