OK, so you've got a handgun and you've barricaded yourself inside a hotel room with a female hostage. What do you do next?

If you're 36-year-old Jason Valdez, the answer is "update Facebook."

Valdez allegedly held a woman hostage inside a Western Colony Inn in Ogden, Utah, in a 16-hour overnight standoff with SWAT teams, and managed to update his Facebook page the entire time.

"I'm currently in a stand off ... kinda ugly but ready for whatever, I love u guyz and if I don't make it out of here alive that I'm in a better place and u were all great friends...." Valdez wrote on his wall at 10:23 p.m. on June 17.

His friends and family then responded to his post, some with messages of support such as "Becareful homie much love to u...," as well as less-supportive notes. One guy responded, "dude you're an idiot."

Valdez continued to update his status throughout the night, posting 15 messages in total, including two mobile phone pics of him and his alleged hostage. (In the photos the two look rather chummy, and Valdez captioned one of the photos, "Got a cute 'Hostage', huh?")

Valdez also received help from outside. One of his friends alerted him that there was a SWAT member in the bushes: "They got gun ner in bushes stay low low..."

Valdez responded to the comment with a "Thank you homie, good looking out!"

The Associated Press reports that police "believe that responses from Valdez's friend gave him an advantage," and that authorities are now discussing whether some of Valdez's friends should be arrested and charged with obstruction of justice for hampering an investigation.

"We're not sure yet how to deal with it," Lieutenant Danielle Croyle of the Ogden Police Department told the Associated Press. "We're talking about it and trying to figure out how do we address the kind of conflict that it presents."

Valdez barricaded himself inside the hotel after Ogden police tried to serve him with a felony drug warrant for missing a June 1 court appearance. Valdez has previously been convicted with aggravated assault and domestic violence in front of a child.

The standoff ended on Saturday morning, about 90 minutes after Valdez posted his last update: "Well I was lettin this girl go but these dumb bastards made an attempt to come in after I told them not to, so I popped off a couple more shots and now were startin all over again it seems..."

When officers swarmed the room Saturday morning, Valdez shot himself in the chest with a handgun; no police shots were fired. On Tuesday, Valdez was still in critical condition and is facing new charges from the standoff, including firing his handgun at police.

Follow Sarah on Twitter (@geeklil) or on Facebook