How can I make custom orders for followers or npc's?
For example: Order an npc/follower to attack an npc/creature.
You mean add things to the "command mode"? I don't think you can.
There's currently not a direct way to get what the crosshair is pointing at via script. The SKSE team has been asked about creating one. For now, a workaround might be to fire an invisible projectile or spell, return the actor that it hits, and then have the NPC initiate combat with it.
Edit: How can I order an npc/follower to escort me? For example: Escort to Whiterun.
Use an http://www.creationkit.com/Escort_(Procedure).