this is an applescript and app that ckecks wether a new screen/ display has been attached and asks for repositioning of your dock
docklocation.app is located under bin/
source is in source/docklocation.applescript
if you want to compile it yourself:
osacompile -s -o docklocation.app docklocation.applescript
open docklocation.app