If the cabin is full of gasoline that would be a problem.
But as long as it is in the tank it is not a problem. Most powerboats under 30 feet or so are gasoline powered and people sleep on them all the time as well as many sailboats. You certainly want ventilation when sleeping but don't need more than you would want without the engine. Before small diesels were common virtually all sailboats had either an A4 or Graymarine gas engine. Even the explosions that do occur usually happen during refueling and are the result of the proper procedures not being taken - blower on for the proper time before restarting probably being the main one. As long as the fuel system is in good shape there shouldn't be a problem. A stern boarding ladder can be installed easily but I agree best not to fall off while sailing.