In order to teleport to you when you go through a door (or otherwise teleport), all the companion needs is to be set as your companion, i.e. you executed the script command SetPlayerTeammate 1.
For a companion to follow you, the companion needs to have a follow package and that follow package needs a condition on it which is true, and all other packages that the companion has need conditions that are false so that they will not run instead of the follow package.
For example. let's say your NPC has a follow package and a wait package, and a variable npc_following and a variable npc_waiting. The follow package has the condition if npc_following is 1 and the wait package has the condition if npc_waiting is 1. If you set npc_following to 1 and npc_waiting to 0, and then execute an evp no the NPC, then they should follow you. If you want them to wait, set npc_following to 0 and npc_waiting to 1. If you accidentally set both variables to 1 then either package could execute, so the NPC might follow you or they might not. If you accidentally set both variables to 0 then the companion will not do anything.
This is the best companion tutorial that I have found:
The other thing that might stop a companion from moving is if they aren't on a valid navmesh. If the area that they are in isn't navmeshed, then they will just stand there.