Scripting a full blown follower that you command with more complex instructions is fairly complicated for me as I'm not very good with scripting. However, if you just want basic stuff, I gave one of my NPC's a follow package that only runs if my quest is at a certain stage. He will follow me anywhere as long as that stage is valid, and he works great. I can't really command him in terms of follow distance, aggression and so on yet, but I think you might be able to set his dialog so that different topics set different stages and have packages with conditions to only be valid during those stages. For example:
Stage 20 - Go back home and wait for me or whatever. (travel package with specific location set to go to)
Stage 30 - Follow me, but keep your distance (Follow package with wide radius set)
Stage 40 - Follow me closer (Follow package with small radius set)
Stage 50 - Hang out here (sandbox that location)
I haven't tried any of these yet, but when I get to the point that I start tweaking my follower a little more this is what I was going to try. Someone else with more experience might help more, but I believe this method
should give me a few basic functional commands.