Don’t know if this is the problem or if this happened with the forum formatting but it looks like you’ve got smart quotes instead of dumb ones. I’ve copied your sample and replaced them below for convenience.
if [[ ! -d "$HOME/bin" ]]; then mkdir -p "$HOME/bin"; fi &&
curl -L https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" &&
chmod +x "$HOME/bin/docker-machine.exe"