Confused how to communicate esp8266 12e with arduino nano

Ok, thanks.

I suggest taking all the code that deals with the hc-sr04 and moving it to the top of loop(). That way, it will still get executed even if there is no new command.