"Like" can take a number of forms, each of which can be achieved in a different way.
One of the most reliable ways to get the players to like/respect an NPC is trust. Set up multiple scenarios where the NPC takes a big risk in trusting the players and having it payoff, and vice versa. This is the classic, "I got your back" situation, used very frequently in movies to establish a partner relationship between two characters.
To make them like/care for an NPC, construct scenes that demonstrate the NPC's vulnerability and provide the players with an opportunity to "do the right thing". The NPC may be injured or asleep, or suffering mental stress and be at the players' mercy. Or, more subtly, the NPC may open up about their emotions, anxieties, or future plans, that they don't want to reveal to just anyone. Or perhaps they need advice from the players as to how to handle some delicate situation.
To make them like/enjoy the company of an NPC, give the NPC some strong (likeable) personality traits, good one-liners, memorable strengths or weaknesses, or so on. The key is to make the players think, "Wow, this guy is... interesting... let's watch him to see what happens next."
All of the above are commonly used in fiction, particularly in multi-hero or action movies. In some cases (often seen in spy movies, cyberpunk stories, etc.) this is then inverted by having the trusted partner betray the primary hero; your players will likely be on the lookout for hints the trusted NPC is going to backstab them, perhaps testing them to be sure. This is also a good way to set up a long-standing arch-enemy (see False Friend, Evil Former Friend, and Face Heel Turn on tvtropes.)
If you want the character to be three dimensional, then avoid stereotypes and look for ways to twist the usual tropes. For instance, understand the "Damsel in Distress" trope and how pervasive it is in modern entertainment, then brainstorm ways of having your female characters act in non-stereotyped ways. Skip the puppies, shoe shopping, and girlish weakness, and avoid killing, maiming, or depowering her; or set your plot up to appear to go that direction, but have it veer off and do something much more unusual and interesting. Don't passively "let the players take her home/back to the awful dimension" but instead have her propose some adventure to the players that gets her some place that betters herself; perhaps she's the only remaining heir to the throne and she's not being considered since she's "just" a woman, but if she had a powerful army under her command, perhaps she'll be the land's first Queen.
Above all put yourself in her shoes. If the other dimension is such a terrible place, she's going to want to do what she can to find any other solution. Can the other dimension be destroyed? Can someone else take her place? Provide some fighting chance for her to escape that terrible fate, and enable the players to assist her in achieving it.
There are two major ways to create a god NPC. The method depends on the purpose the character serves in the campaign. In either case, the god should help facilitate an adventure for the PCs. It is seldom a good idea to create a powerful NPC with a strong presence that fails to further the story.
The Golarion Pathifinder setting provides excellent examples of both methods with true gods and demigods, as described below.
1. Plot Device
I sometimes call this a "force of nature" NPC. A plot device god works best as some nebulous force that drives the plot by helping the PCs or complicating their lives. They rarely should directly interact with the PCs. The goal of any encounter with the plot device god should involve a quest, social encounter, or any other encounter that does not involve physical confrontation. A friendly plot device god might be a quest giver while an enemy plot device god might create a storm or a curse that can only be appeased with a quest.
Roleplaying Interactions
If the god must expose themselves to direct confrontation, then make sure all interactions are fun and interesting to the players. If a PC attacks then, don't just say "it doesn't work." Have something interesting happen, like the weapon going through them or blowing the fighter away. If you don't want this to happen at all, then have the god manifest in a way that makes it impossible for both sides to directly affect each other. Maybe the god appears as a reflection in the mirror or as a ghostly avatar.
Statistics
A god as a plot device should not have any actual statistics. Creating a stat block is unnecessary, patronizing to the players, and limits your ability as a GM what they can and cannot do. By creating a stat block, you create limitations of the character's power, which is not something you want to do when creating a character as an unassailable force of nature.
Example
True gods in the Golarion are excellent examples of plot device gods. They have no statistics and rarely directly interact with PCs. True gods affect a plot by changing the circumstances or direction of an adventure. For example, in the module Clash of the Kingslayers, a god transforms a temple into a massive walking monster that the party has to go inside and explore in order to figure out a way to stop it. In the Wrath of the Righteous adventure path, a goddess offers mythic power in exchange for passing a test.
2. Active Character
A god as an active character essentially functions as a very powerful NPC. As such, you would stat and run them as you would any sufficiently powerful NPC. Such a god directly affects the PCs with their actions. However, it's absolutely vital that the PCs can interfere with or invoke those actions. Do not have an evil god enact an evil plan unless the PCs have some way to thwart it. Do not allow a good god fix a problem unless the PCs actively do something to receive that aid.
Roleplaying Interactions
You need to determine a good reason why an active god won't wipe out a party or make an adventure trivial. An enemy god might not be able to do so or find it impractical to directly confront the PCs. Maybe they don't see the PCs as big of a threat to directly deal with? A good god might be too occupied to directly do the PCs's work for them.
Usually the best way to handle it is having the PCs only interact with NPCs that work for the god. Maybe they have to face the evil god's minions. Maybe they can only speak to a good god by their servants. For a low level campaign, an active god should work more like a plot device god.
Only have an active god directly confront the PCs if you intend to change the direction of the plot (like a plot device god) or allow the PCs to directly affect the god.
Statistics
Follow the monster creation guidelines in the Monster Manual as you would stat any other creature. Don't just make up a list of absurd stats. Instead, determine what CR the god should be based on how high of a hypothetical party should be able do and then stat them accordingly.
Examples
Demigods in the Golarion setting are good active god examples. Unlike true gods, demigods in Golarion usually have statistics as a CR 20-30 creature. They're designed as powerful final opponents for a high level party or as rare allies called upon sparingly.
The Treerazer and Arazni are good examples of enemy active gods. The Treerazer is a demon trapped in a blighted forest that slowly tries to expand his influence. Arazni is a queen of an undead nation. Both of these demigods can directly affect the party without actually confronting them. A campaign using these gods will likely see the PCs thwarting their evil plans from a distance and taking down their minions until the campaign reaches a climax that confronts the demigods themselves.
Talmandor is a good example of an allied demigod as he's a force of good that likes to take an active role in a nation's politics and crusades. However, he rarely directly interferes with mortal affairs unless directly asked or if a massive national threat occurs.
Best Answer
Ok, there's two ways to go about it. Limited use, or limited reliability.
Limited Use
This is simple: as a reaction, teleport up to your move. Reaction rules limits this to 1/round.
Limited Reliability
Follow the 3.5's Wall of Blades 'spell' example: opposed rolls. Pick a save that makes sense (might be Dexterity, for reaction, or Intelligence, for the focus required, for example). I'd probably go with Dex. As a free action, when attacked, roll a Dex save. If this is more than the incoming attack's roll, teleport 5ft vs ranged or your move speed vs melee, avoiding the attack (ranged vs melee difference to keep the enemy from moving away too fast when the melee haven't even caught up yet). Limit this to when you're aware of the attacker and able to react (or in other words, when the enemy doesn't have advantage on their attack).
In any case, go with a pitifully low AC, especially with the second effect. It amounts to a 50% miss chance, pretty much enough to keep things ok
The Prestige Way
This is actually like a magic trick, in that under the hood, no teleportation-dodge happens. It just looks that way.
Build the villain for a high AC through Dexterity. Give him 'when an attack misses you or you pass a dexterity save, you can move X feet'. Describe misses as missing (and saves passed) because of the teleportation, not the other way around. Roll a die behind your screen when the players attack, and pretend to care of the result and blame it for the 'active' misses.