So, if I understand correctly, you can ssh from machine 1 to machine 2 but not from your laptop (from which you can ssh to machine 1). So you'd like to have a socks server on machine 1 and use it from your laptop? So looks like all you need is port forward that 8080: run on your laptop:
ssh -nL 8080:localhost:8080 machine1 ssh -C2qnN -D 8080 username@machine2