TL;DR
When assigning a recipe which requires a liquid to an assembly machine, the assembly machine should detect nearby pipes and automatically face its input pipe towards them.What ?
[Left] The default assembly machine rotation. Note the input pipe is always facing north.[Right] My suggestion. When the assembly machine is assigned a recipe requiring a liquid, it will first check each adjacent tile, rotating the input if either a pipe or underground pipe end is found. If multiple pipes are found, it checks the liquid contents of the pipe, favouring the required liquid for the assigned recipe.