If you are in a debug session you are prevented from running sql via sql-window. But you are not prevented from e.g. 'add debug information' for packages via context menue.
That may result in hanging session.
There is a Program Window preference "Allow compilation while running" for this. If disabled, you cannot add debug information while debugging. If enabled, you can cause these issues.