Is wiring laying alongside an attic access opening a code violation or safety concern?
This sounds like an issue from a physical damage standpoint

While the NM cable only needs to be protected by guard strips if it's within 6' of a scuttle hole in your case, as per NEC 320.23(A) (referred to by NEC 334.23):


  (A) Cables Run Across the Top of Floor Joists. Where run
  across the top of floor joists, or within 2.1 m (7 ft) of the floor
  or floor joists across the face of rafters or studding, the cable
  shall be protected by guard strips that are at least as high as the
  cable. Where this space is not accessible by permanent stairs or
  ladders, protection shall only be required within 1.8 m (6 ft) of
  the nearest edge of the scuttle hole or attic entrance.


your attic seems to be intended as a storage space.  As a result of this, the exposed cabling you describe in your OP would be subject to physical damage, which would require protection from physical damage as per NEC 300.4:


  300.4 Protection Against Physical Damage. Where subject to
  physical damage, conductors, raceways, and cables shall be
  protected.


and 334.15(B):


  (B) Protection from Physical Damage. Cable shall be protected from physical damage where necessary by rigid metal
  conduit, intermediate metal conduit, electrical metallic tubing,
  Schedule 80 PVC conduit, Type RTRC marked with the suffix -XW, or other approved means. Where passing through a floor,
  the cable shall be enclosed in rigid metal conduit, intermediate
  metal conduit, electrical metallic tubing, Schedule 80 PVC
  conduit, Type RTRC marked with the suffix -XW, or other
  approved means extending at least 150 mm (6 in.) above the
  floor.
  
  Type NMC cable installed in shallow chases or grooves in
  masonry, concrete, or adobe shall be protected in accordance
  with the requirements in 300.4(F) and covered with plaster,
  adobe, or similar finish.