Yes, it does match. Which is why it's not moving into the else branch. But without a matching group it doesn't know what to put into $1, so it just prints an empty line.
Compare your code with this:
my $test = "SWER~~ERTGSDFGTHAS_RTAWGA_DFAS.x4-234253454.in";
if ($test = ~ m/(~{1,2}[A-Z].*[xX]4)/) {
print "$1\n";
}
else {
print "No match...\n";
}