I am stranded in a ship and do not have the access to pilot it and there are password-protected doors blocking me from even leaving the cockpit. I have tried to send a message to the owner using the button/icon, but when I click to send the message, the following error appears:
An Error type: Exception with the Message: Argument 2 passed to MessageUtil::sendMessage() must implement interface Entity, boolean given, called in /swcombine/http/main/www/htdocs/members/messages/msgframe.php on line 156 and defined has occured. It has been stored as Error 7731.
If this bug has not been reported (check first, please), report it to the bugtracker at http://bugs.swcombine.com/
Is there any other way to find out who owns the ship and contact the person, or is there any way to get out of the ship (I believe the ship is in space, but I'm not sure how to check this) or at least to the room where I can enter/exit the ship so that I can get picked up by someone else?
Odd that the contact owner button isn't working - might want to make a bug report in the bug base (link at the bottom of the sidebar on the right, you'll likely need to make a new account). Otherwise, you are going to have to do some sleuthing.
If you were in a faction and it was a faction owned ship, try contacting them or their leader. A lot of factions also put tags at the front of their names to identify them as theirs, usually in  brackets. This can help.
If you were the pilot before hand, then there may be an event telling you you were unassigned, and if its not still bugged should tell you who did it.
Finally, you can always make a thread in the Traders Lounge (or possibly use the 'looking for entity' thread, but it may get lost) with the ships name, ID if you can get it, and any other pertinent information you can find/remember about it. Someone may be able to help you.
And, as a last resort, if you have tried all the above things, you can contact an ASim (like me) to drop your character. THis basically kills off your character and you can respawn in a weeks time with a new name/character/etc.