It's important to recognise that the behaviour of VHDL is well defined.
Within a clocked process, the value of every signal is effectively frozen immediately before the instant the active clock edge occurs. So, for example, the classic 'how not to swap two variables' example:
if rising_edge (clk) then
b <= a;
a <= b;
end if
...actually DOES work, because the two assignments aren't executed one after the other like they would be if the code were being executed on a CPU. They don't both end up equal to the original value of 'a' like you might expect.
Instead, what the code means is: at the instant the clock arrives, 'b' takes the value that 'a' had immediately before the clock, and 'a' takes the value that 'b' had immediately before the clock.
With a DPRAM, if you read and write the same address on the same edge, you'd normally expect the output to equal the old contents of the address being accessed, because at the instant the clock arrives the new value hasn't been latched into memory yet.
By explicitly including a condition that the output should equal the new input if both the read and write pointers are equal, you're effectively bypassing the memory entirely - and that's completely OK if that's how you want your logic to work. Some FPGAs actually include this 'shoot through' or 'bypass' feature when you instantiate their internal RAM blocks.