If liquid and gas are both chaotic states of matter, what's the difference between them on the molecular level? I'm a laywoman in physics and recently found myself pondering about the matter reflected in the title of this post.
To make my question more precise from the mathematical standpoint, let's suppose you are given a 3D image of the momentary positions of the nuclei of all atoms of an unknown monoatomic substance in a certain volume at a certain moment of time. Rotating the image in a 3D visualization program, you see that the positions look pretty chaotic from any angle, unlike a crystalline structure. You know neither the image's scale nor any of the parameters such as the pressure or temperature. The only information you are given is that the substance is not ionized and is in a thermodynamic equilibrium and  either in the liquid state or in the gaseous state and that the pressure and the temperature are below the critical pressure and the critical temperature, respectively. You can extract the numerical XYZ positions and do any calculations with them, but, as stated above, you don't know the scale. How can you tell whether it's a liquid or a gas? What criterion can be used to reach that end?
My first guess was that whilst a gas doesn't have any correlation between the positions, a liquid does, but then I realized it's a wrong answer because a gas is not necessarily an ideal gas, so it's unclear to me how I can tell whether it's a liquid or a gas if there's some correlation between the positions in the image. I tried to find the answer on the Internet and this SE, but did not succeed and humbly hope that physics experts on this SE can tell me the answer. 
UPDATE: Sure, the limiting cases of an ideal gas and a tightly packed liquid are easy, but what do I do in the general case? In other words, how can I deduce whether it's a liquid or a gas if the spread of distances between neighboring nuclei is moderate, that is, neither very small nor very large? 
 A: I will try answer your question in the Landau paradigm of phase transition. I follow the beautiful Lectures on Statistical Field Theory by David Tong. See section 4.1.

Phases of matter are characterised by symmetry. More precisely, phases of matter are characterised by two symmetry groups. The first, which we will call G, is the symmetry enjoyed by the free energy of the system. The second, which we call H, is the symmetry of the ground state.

Example 1:
The simplest illustration is the Ising model without a magnetic field. The free energy has a $G = Z_2$ symmetry. In the high temperature, disordered phase this symmetry is unbroken; here $H = Z_2$ also. In contrast, in the low temperature ordered phase, the symmetry is spontaneously broken as the system must choose one of two ground states; here H = ∅. The two different phases – ordered and disordered – are characterised by different choices for H. 
Example 2:
In contrast, when $B\neq0$ the free energy does not have a $Z_2$ symmetry, so G = ∅. According to Landau’s criterion, this means that there is only a single phase. Indeed, by going to temperatures $T > T_c$, it is possible to move from any point in the phase diagram to any other point without passing through a phase transition, so there is no preferred way to carve the phase diagram into different regions. However, this also means that, by varying B at low temperatures $T < T_c$, we can have a first order phase transition between two states which actually lie in the same phase. This can also be understood on symmetry grounds because the first order transition does not occur at a generic point of the phase diagram, but instead only when G is enhanced to $Z_2$.

Example 3:
The discussion carries over identically to any system which lies in the Ising universality class, including the liquid-gas system. This leaves us with the slightly disconcerting idea that a liquid and gas actually describe the same phase of matter. As with the Ising model, by taking a path through high pressures and temperatures one can always convert one smoothly into the other, which means that any attempt to label points in the phase diagram as “liquid” or “gas” will necessarily involve a degree of arbitrariness.
It is really only possible to unambiguously distinguish a liquid from a gas when we sit on the line of first order phase transitions. Here there is an emergent $G = Z_2$ symmetry, which is spontaneously broken to H = ∅, and the two states of matter – liquid and gas – are two different ground states of the system. In everyday life, we sit much closer to the line of first order transitions than to the critical point, so feel comfortable extending this definition of “liquid” and “gas” into other regimes of the phase diagram, as shown in the figure.

So to conclude, there is no differences between a liquid and a gas. One can distinguish between them only when a first-order phase transition occur. But you can easily distinguish solid state from gas/liquid due to differences in symmetry.
A: Everything you've said is correct, which is why the conclusion is: there is no fundamental difference! Under the modern classification, they're just the same fluid phase of matter.
For example, consider the phase diagram of water. If you take water vapor, slowly heat it up, then pressurize it, and then slowly cool it down, you'll end up with liquid water. This entire process is completely smooth. There isn't any sharp point, like a phase transition, where the behavior qualitatively changes; thus we can't make a sharp distinction between liquids and gases. 
There are fluids that are "liquid-like" (densely packed, strong interactions between neighbors) and fluids that are "gas-like" (sparse, weak interactions between neighbors) but no dividing line, just like how there's no moment where a shade of grey changes from white to black.
By contrast, ice really can be distinguished from liquid water or water vapor. You can't turn either of the two into ice without crossing a phase transition. At that point, the atoms will suddenly become ordered, and you can see this from a snapshot of their positions. 

Edit: in response to the 25 comments, I'm not saying there's no difference between liquids and gases, I'm saying that there are clearly liquid-like things, and clearly gas-like things, but a continuous spectrum between them. Here are some properties that characterize gases:


*

*large distance between molecules

*weak interactions

*large mean free path

*high compressibility

*very low surface tension

*upward density fluctuations at small separation


The opposite properties characterize liquids. In the easy cases, you could use any of these to make the call. But all of these properties change continuously as you go from one to the other, as long as you go around the critical point. This isn't true for a solid/liquid or solid/gas phase transition. 
A: The described measurement would allow you to construct the Radial Distribution Function, the probability of finding another particle a distance r from a reference particle usually given as g(r), which has a unique signature for each phase.
The plot below from https://en.wikibooks.org/wiki/Molecular_Simulation/Radial_Distribution_Functions shows g(r) for argon in different phases. 

Argon of course does not have strong interactions you might be tempted to argue this is a trivial case of an ideal gas vs. a close-packed liquid but that would be incorrect. A real gas only has one peak (called a coordination sphere), while a liquid will have multiple peaks. All of this is very nicely explained in the link above. 
Also note in the image provide the x-axis is normalized by $\sigma$ which is the molecular diameter meaning that this measurement is scale invariant and satisfies the conditions laid out in the question. 
EDIT: 
In response to this question about the phase transition there certainly is a phase transition between liquid and gas and the mechanism is nicely described and modeled in the link in the comments from @EricTowers, http://rkt.chem.ox.ac.uk/lectures/liqsolns/liquids.html, a quote from there referencing a applet that lets the user play around with different conditions in a molecular dynamics simulation, which is used to model these systems. 
"(iv) With the density at its minimum lower the temperature and you will see that the atoms start to form small clusters (this takes some time). On the limited scale of the simulation this is condensation to form drops of liquid. It makes it clear that the attractive forces are responsible for the formation of the liquid state. "
This plainly describes the process of the transition, in this case, from gas to liquid. The transition occurs when the thermal energy in the molecules can no longer overcome the inter-molecular forces and the molecules begin to 'stick' together, condensing. To go from liquid to gas, the opposite happens and the thermal energy is sufficiently high that the inter-molecular forces cannot make the particles stick together. This is the reason for the bumps in the graph shown in the answer, and why gases have one coordination sphere that decays as a function of distance. The details of the gas radial distribution function tell you about the inter-molecular forces but there is no sticking, so there is only one bump. 
A: Let’s try a simpler, less technical answer. Molecules do attract each other. That is what makes a solid a solid.
In a gas these attractive forces are weak enough to let the sample spread, while in a liquid there is enough attraction between all molecules involved, that the whole remains cohesive, even if individual molecules fly by each other.
A: In a gas the molecules move separately. In a liquid they cling together due to van der Waals forces which are strong enough that the vibrating molecules do not completely separate.
A: In principle only: we have an 3D image of 


*

*position of nuclei of a unknown monatomic gas or liquid, 

*in thermodynamic equilibrium, temp and pressure below critical point,

*no scale, no pressure, no temperature, no velocities.


In a monatomic liquid, the atoms (and therefore nuclei) are approximately the same distance apart (kind of "touching"), but in a gas there would be a significant spread of distances between the atoms. You could use this to make a reasonable guess as to whether you have a liquid or gas.
A: It is an interesting question which has an answer but it is not a simple answer for at least three important reasons. The first one is that, in order to provide a precise answer, one should know quit well the progresses made in the physics of the liquid state in the last half century, which have not fully percolated into university textbooks but are still scattered in many specialistic papers. The second reason is that dust has not completely settled on this issue. The third one has to do with he issue of separating theoretical arguments and their practical usability.
Let me start from a brief summary of the simplest well known things which are  in part present in some of the answers you already got.


*

*Although, below the critical point, liquid and gas are separated by
a first order phase transition, this transition line ends at the
critical point and it is possible to go from states at different
densities below and above the coexisting densities at subcritical
temperatures, just choosing a path ‘circumnavigating’ the critical
point, without crossing the first order line.  This implies the
possibility of a continuous transition from “liquid-like” to
“gas-like” states and the continuity implies that there is no point
where it is possible to put a sharp border between gas and liquid.
That’s fine from the thermodynamic point of view, but does not
answer the question which is more related to the possibility of
establishing a structural difference between liquid and gas
compatible with the unambiguous classification
of the states close to the liquid-gas transition line.
In a way, the key problem is to identify a sharp structural
characterization, compatible with the cases where thermodynamics is
able to provide  a simple classification, although no sharp boundary
can be found on purely thermodynamic ground.

*JJR4’s answer also contains some key ingredient of a modern answer
to your question, i.e. emphasizing structural features able to
characterize the difference between liquid and gas (at least below
the critical point. The weak points of his argument are that it is
too much bound to the case of rare gases (insisting on the single
peak) and that his picture it is clear for states significantly below the
critical point, leaving some doubts about the extent of the phase
space region where such a structural criterion could be used.

*The usual way of identifying a phase by using only physical
quantities at one thermodynamic state is the introduction of the
so-called order parameter, i.e.  a quantity which is zero in one
phase and different from zero in the target phase. While in cases
like the fluid-solid transition the solid can be clearly identified
in many ways by measuring quantities in one phase, for example
looking for  the presence of at least two non zero elastic
constants, the usual order parameter of the gas-liquid transition is
proportional to $\rho_l - \rho_g$, i.e. is not a one-phase quantity.


Now, let’s list a few less-well-known facts emerging from research in liquid state theory more up-to-date than the knowledge available at the end of the fifties, which is more or less what is usually present in textbooks, with a few exceptions.
Already in the sixties it was experimentally identified a sharp region of anomalies in some  physical quantities (Rahman spectra, maximum of constant pressure specific heat,…) in the density-temperature plane, nicely corresponding to a continuous extension of the so called coexistence line diameter, i.e. the line made by the middle  of segments joining points on the coexistence line at the same temperature. Research in this direction has continued until recently and theoretical ad experimental work is still in progress. During the years, it has been realized that there are qualitative differences of physical behavior which depend on, but do not coincide with the thermodynamic conceptual separation between liquid and gas. This is a first important point to grasp.
A few candidates for separating liquid-like vs gas-like behavior have emerged ( see this wikipedia page for a short reference): the Widom line is the above mentioned line of anomalies. Another line, the Fisher-Widom line, separates the region of asymptotic exponential decay of the pair correlation function from an an asymptotic oscillating exponential decay. And finally, the Frenkel line, more based on dynamical evidence (it can be defined as the line separating monotonic and non-monotonic decay of the velocity autocorrelation function with time).  
The reason I am speaking of “candidates” is because the existing experimental evidence is not comprehensive enough to allow a sound generalization to every possible case of liquid-gas transition. However, evidence is accumulating and a few facts have emerged.
Most of the best indicator to differentiate liquid- vs gas-like behavior are dynamical quantities (see a recent paper), thus not suitable to answer the original question. However, there is one method which is directly connected to a purely structural criterion, giving theoretical support to an improvement of the suggestion of looking for a second maximum of the $g(r)$. It is connected to the  above mentioned Fisher-Widom (FW) line. Therefore, it is somewhat related to the appearance of a second peak of the radial correlation function although it is not coinciding with that.
The best available evidence shows that the original FW criterion is only approximate and it fails if the range of interaction is not finite. A study  by Vega et al.  where a long range smooth cut-off of the  Lennard-Jones potential was progressively pushed toward larger distances showed that the FW lines moves into unphysical regions. However looking at the $g(r)$ at intermediate  distances larger than the first peak position but not beyond the cut-off point, the presence of oscillatory behavior or not could be a satisfactory indicator of liquid-like or gas-like behavior.
In the following figure, adapted from Fig. 7 in the Vega et al.  paper, the intermediate range behavior of the pair correlation function $h(r)=g(r)-1$ (actually the of  $log(r h(r))$) has been plotted, for a liquid-like  state (full curve) ad a gas-like (dahed line) state. The arrow shows the position of the cut-off distance beyond which the pair potential is exactly zero.

It is clear that both curves do not show any oscillating asymptotic behavior, but intermediate range oscillations are clearly visible in the case of the full line curve.
At the present day this is the best criterion based only on structural information I could advise. 
Of course, it is not perfect, and, if data are available, I would rather recommend criteria based on characterization of dynamic quantities, like in the case of  the Frenkel line. However, I notice that, even if approximate,  a criterion based on  intermediate distances behavior has some practical advantage on those based on asymptotic analysis. First of all it does not require difficult extrapolations and it is less affected by the unavoidable numerical noise of experimental or simulation data. Moreover it is less depending on asymptotic features of the interaction potential which are difficult to assess experimentally.
In conclusion, I would summarize the main points which can be extracted from  the last 50 years of research in liquid state.


*

*Thermodynamic distinction between liquid and solid is only one
possible criterion, but it is not telling the whole story about
qualitative differences of behavior of fluid systems in the
thermodynamic phase space.

*Alternative characterizations of the behavior which we name
liquid-like or gas-like behavior exist and are subject of current
research effort in the field. Although such methods have been mainly used to characterize super-critical states, they provide a sound base to identify good candidates for one-phase order parameter differentiating liquid and gas below the critical point.

*Static structural information, as represented by the pair
correlation function may not be the best indicator to use as a
one-phase order parameter, but some approximate method could be
based on the intermediate range behavior of $g(r)$ (oscillating or
not).

*A final word of caution should be said to avoid to use any of such
criteria too close to the critical point. There, the physics is
dominated by critical phenomena and the neighborhood of the critical
point should be treated in a a completely different way. In that case I would hesitate to distinguish between liquid-like and gas-like behavior.

A: What you are looking for is the 3-dimensional Voronoi diagram. I am not a physicist, but it is obvious to me as a mathematician that a liquid will have a very different distribution of Voronoi cell volumes compared to a gas, at any single point in time. I guess it should be easy for you to run some simulations to find out what the distribution should look like in each case. And then you can apply statistical tools to determine which is a better fit for any given data set.
A: 
How can you tell whether it's a liquid or a gas? What criterion can be used to reach that end?

The criterion you are looking for is the magnitude of the density. That is the order parameter in this case. At some point in the phase diagram the density will change by a large amount, which indicates a phase transition. If the change would be discontinuously you would talk about a first order phase transition. The whole situation is very analogous to the situation of an Ising magnet.
Of course the system needs to have a reasonable size to make statements about quantities like this. If there are only a few molecules you won't be able to assign a definitive phase to them. Read about Mean Field Theory, Ginzburg Landau Theory, Spontaneous Symmetry Breaking,... A great reference is the book by Goldenfeld.
A: I will start from JJR4's nice answer. In addition to these nice charts - argon phases can be quantified a bit more. The radial distribution function relates local density to bulk density:
$$g(r) = \frac{\rho(r)} {\rho_{bulk}}$$
For argon, the local density can be modeled with the Sinc() function for positive
$x$,
$$ \rho(r) \propto \frac {\sin(k \cdot r)}{r}$$
The $k$ coefficient can be thought as materials particles' ability to form periodic structures.
Now we can classify phases a bit more easily:


*

*$k$ high $\to$ solid

*$k$ medium $\to$ liquid

*$k$ low $\to$ gas


If you count the total number of peaks in a given argon $g(r)$ RDF function you will see that:
$$ k_{\text{solid}} \approx 2\,k_{\text{liquid}} \approx 4\,k_{\text{gas}} $$
So returning back to the question, from the graph of $g(r)$ it can be seen that a liquid has low and high particle local density areas, while a gas, has almost uniform local density, i.e. gas molecules shows almost no particle package.
BTW, as many has noticed, three different main material phases does not mean that there can't be more phases; of course there can be. Like super-liquids, plasma (yet another gas type) and many more. This fact can be reflected by the $k$ coefficient uniform variation.
A: I don't think there's a wrong answer here, but I'd like to provide a simple one.
In a gas, thermal noise is the dominating factor governing movement.  In a liquid, the dominating factor is the intermolecular forces.
Due to the extremely large number of molecules involved and the central limit theorem, this transition is quite sharp.
If one goes to the extreme, one finds things like supercritical fluids which act like neither gases nor liquids, so it is very reasonable to expect this simple rule to fall apart in the extremes.  Indeed, all rules fall apart, which is why we had to create a new name for supercritical fluids and identify their different behaviors.
If one looks at precisely the boiling point of a liquid, one finds that the assumption that everything is homogenous, and thus can be described as "liquid" or "gas" gets murky.  All rules fall apart there as well.
A: In this situation, your best bet to reach an educated conclusion is to estimate the average distance of interparticles in your image and compare it with mean free path for ideal gas, putting in reasonable numbers for temperature and pressure and effective mass/size of molecules for an artificial ideal gas system. By adjusting for different realistic parameters (such as assuming hydrogen, oxygen mass etc) you should have a good grasp on a realistic range of mean free path for a real gas with guidance from an ideal gas system.
The point is that, if your image is a liquid system, the average distance estimated from your image sample should be very different (in of order of magnitude smaller) compared to your rough estimate of the mean free path of your fictitious ideal gas system.
A: The difference is in the level of order. When physicists speak of a solid they mean a crystal, that is a phase of matter characterized by a long-range order: a crystal structure that extends for thousands and thousands of atoms. The atoms in a crystal do move around their positions, but they do not go too far, and this is clearly discernable in diffraction experiments.
Gas is the opposite case: the atoms are sparse, i.e. the distances between them are huge, and they move chaotically and independently on each other.
In a liquid the atoms are sufficiently close to each other that their movement is not independent: displacement of one atom clearly affects the movement of its neighbors, but not the neighbors many thousand inter-atomic distances away. And, unlike in solids, the atoms do not move around fixed positions and with time may travel quite far away.
It is worth noting however that what may appear as a solid to a layperson often happens to be a very slowly moving liquid. Yet, what I said about liquids remains correct, if you observe them for long enough (years or decades).
A: Take the volume of the substance divided by the number of molecules. Now take several regions whose volume is equal to ten times that amount. For each of them, measure the number of molecules inside. Then plot a distribution. 
For an ideal gas, the probability of there being a molecule in one region is independent of there being a molecule in an adjacent region. You can get a cluster of lots of molecules, or a large void with no molecules. Because of this, the distribution will be rather wide, with only about a 1/8 chance it'll be exactly ten. For a liquid, however, the presence of a molecule in one location will affect the probability of having one in another location, and the distribution will be tighter, and the peak at ten will be much sharper.
A: "I'm a laywoman in physics and recently found myself pondering..."
Given that you articulated your query so clearly despite this self-assessment, we should all wait for the questions you ask when you are no longer a laywoman in physics.
$(0)$ I'll start off by saying that in my opinion, the first part of @knzhou's answer is correct. The reason you are having trouble drawing a line between what is a liquid and what is a gas is that there isn't one; both are fluid (things that can flow). This is the macroscopic consequence of the microscopic fact that the underlying constituents are in a chaotic state of motion.
There are several ways to see that the distinction between liquid and gas is an artificial one, but, in most cases, the distinction between fluid and solid is something that is very clearly defined (in terms of macroscopic, observable criteria). Below, I list the ones I can think of. I wouldn't be surprised if there are more:
$(1)$ Relevant variables and Equations of motion: All fluids are characterized by flow. That is, at each point in the material, one can assign a material velocity $v$, which is interpreted as the (locally defined) velocity of flow of the material. Equations of motion (that is, equations that govern the evolution in time of a general, non-equilibrium state) for any fluids involve $v$, and local thermodynamic variables (density, pressure, temperature, etc.).
For example, the Navier–Stokes equations will describe both liquids and gases. What will change between liquids and gases are the coefficients that enter the equation, for example, coefficients of viscosity, etc. But the form of the equations remain the same. The difference between liquid and gas is therefore merely a quantitative one, seen from this point of view.
In contrast, the solid phase will be described by elastic deformations (as against flow). The form of the equations of motion of a solid will be qualitatively different from the equations of motion for a fluid.
$(2)$ Symmetries obeyed: Fluids obey continuous translation symmetry. In case of many fluids (for example, water), condensation involves explicit breaking of this symmetry, as the fluid settles down into a crystal (called "ice" for water). The fact that ice is a crystal implies that it obeys discrete translation symmetry.
This is once again an example of a qualitative distinction between solid and fluid. Once again, there is no possibility of drawing any such qualitative difference between liquid and gas, because they both obey identical symmetries.
I should add (and I know very little about this) that not all liquids freeze (i.e., settle down into crystalline order) as they condense. An amorphous solid (like glass) is not crystalline, therefore solid glass has the same symmetries as molten glass; therefore, even though it appears solid, glass is really a very viscous fluid. If you apply force on a piece of glass and wait long enough (maybe many years), you will see it flow (that is, see it undergo permanent deformation, like a fluid, rather than elastic deformation, like a solid)
$(3)$ The Phase diagram itself: I'll refer to @knzhou's link for the phase diagram for water. (https://commons.wikimedia.org/wiki/File:Phase_diagram_of_water_simplified.svg)
When water boils at $NTP$ (normal conditions) there seems to be a phase change not withstanding the above facts; for example, the density clearly has a discontinuous jump between the two. But should this imply that we are dealing with two separate phases?
I'll not answer this directly. Instead, I will draw your attention to two facts that can be seen from the phase diagram itself. It is true that there is a range of pressures for which, when we increase the temperature, we encounter a discontinuous jump in density. The points at which this jump occurs form an extended curve in the $T-P$ plane. But it is also a fact that this curve terminates, at the critical point.
This implies the following: pick one configuration of water molecules that you think looks gaseous, and another that looks liquid (these two configurations refer to two points on the phase-diagram). There exists a thermodynamic process that takes you between these configurations (i.e., a curve on the $T-P$ plane joining the two points) during which you encounter no discontinuous jumps in density!
tl;dr: If two "states of matter" are connected via a continuous change in thermodynamic parameters, obey the same symmetries, and are governed by the same equations of motion, they are really the same thing. They should not, in my humble opinion, be recognized as distinct "Phases" in any well defined, macroscopically observable manner.
This last remark is relevant for the original setting of your question; we can conclude that:
In a general case, there is no way you will be able to tell a "liquid" apart from a "gas" by looking at a snapshot of all the molecules at a given time.
A: The answer is quantum mechanics (QM) and distance. I will use H2O as an example.
The answer to your question is not surprisingly QM. Liquid H2O has something special between the molecules that gaseous H2O does not have. It is a QM phenomenon, and you can read about it in many ways (van der Waals forces, London forces, and electrostatic forces), but truly it is a QM phenomenon.
The beautiful thing about QM is that there is no difference between the liquid and gaseous H2O molecules themselves. The difference is the force between the molecules (that the molecules only feel at certain distances).
Your question is really: Why is there this force between liquid H20 molecules that gaseous H2O molecules do not have (actually they have it but they are too far apart to feel it)? The answer is distance.

Do molecules of liquid repel or attract each other?
Now you have to bring these gaseous H2O molecules close together to reach a limit, and when that happens, you trigger QM, and a new QM connection phenomenon is made between the molecules that is attractive at certain distances.
How can you reach that triggering distance? You need pressure. As soon as you add enough pressure to gaseous H2O, it will turn into liquid.
Now you are asking how to tell whether the actual phase of H2O is gaseous or liquid.  The answer is the curvature (or lack of it) of spacetime. Take them into a vacuum box, into flat space, and let them float. Take time, but only in the case of liquid H2O will you see them clump together, just to form into single drop shaped perfect sphere.
Only liquid will form a perfect shape, that is a sphere inside the box. Gas cannot do that; gas will fill the box equally.
A: It is a question of the balance between kinetic (thermal) motions of the molecules (atoms) and gas/vapour pressure. In a solid the van der Waals force) brings the molecules together so that they form a rigid structure. The thermal motions are not sufficient to break this structure. When the substance is heated, thermal motions break the structure. At low pressure there is nothing to bind the molecules, and they form a vapour.  
At a temperature above the triple point, the solid phase becomes impossible. At pressures greater than the triple point vapour pressure can be sufficient to cause some of the substance to form a liquid. When liquid and vapour are present together, the evaporation of the liquid would lead to a high pressure and means that a single phase is unstable. The liquid and gas phases are really two parts of the same. The van der Waals force has some role, for example in generating surface tension and promoting the instability, but it is not the main reason. The phase diagram makes clear that the change from vapour to liquid is simply due to the increase in pressure. At sufficiently high temperature, the critical point, the liquid phase no longer forms.

A: 
Rotating the image in a 3D visualization program, you see that the
  positions look pretty chaotic from any angle, unlike a crystalline
  structure

I assume the OP doesn't see a clear difference between liquids and gases from the molecular point of view. And  the solids are not in question because of its cristalline ordered structure.
But its ordered structure is also an ideal case. If a metal is heavily cold worked (what happens often) for example, the density of dislocations can be so high that a 3D visualization program could show a pretty chaotic atom arrangement. 
The same happens if the region scanned by the program is in the grain boundary of a policristalline metal. And metals in our daily life are policristalline, with a very large grain boundary total area.
So, if we want to state any kind of absolute mathematical criteria, I don't think that ordered or disordered atoms arrangements can be a good candidate to make any difference between liquids, gases and solids. There will be always a lot of exceptions that contradicts our usual meaning of that concepts. It is like to say that glass is really a liquid, what doesn't make sense.
And the usual meaning of that concepts are macroscopic and practical. 
A solid, even when plastic enough to be forced to fill a mold, doesn't collapse immediately by its own weight.
A liquid needs a container, otherwise it does colapse immediately due to is weight.
A gas needs a closed container, otherwise it diffuses to the surroundings.
