Shouldn't this be considered correct also?
היינו במסיבה לפני יומיים
I agree! Had the same issue :)
Can שלשום not also be placed at the end of the sentence?
yes, it can
How would one distinguish in Hebrew "We were at a party" from "We were at the party" ?
When it's spoken the ב in "at a party" is pronounced "be" and "at the party" is pronounced "ba". The prepositions merge and share sounds. It works for ב, ל, ה and probably some others, ש and מ don't like to mix with others though.