If condition strange behaviour
Test the code in a structured, predictable way. Simplify it where possible. Print all values.

Post entire programs (where practical) so people can test it on their machines. Incomplete programs are hard to test, so it is harder to help.

First, what is mySerial? Is it an instance or reference to Serial? Replace mySerial with Serial. Then it is clear to everyone what is being used. 

Secondly Serial.write(val) literally prints a binary byte, the lower 8 bits of of an int. which will be interpreted as an ASCII character by the Arduin's serial monitor. Binary values can be very awkward to debug.

Use Serial.print(val) or Serial.println(val) instead. This converts a binary number (e.g. in an int) to a 'human readable' number, by default printed as base 10, using the digits '0' to '9' (see the Arduino Serial documentation)

When testing and something strange is happening, remove every hard to control or predict part. 'Instrument' with print statements to see what is happening. (or get a debugger)

Change

int svalue(int analogVal){
    if((analogVal &gt; 135) &amp;&amp; (analogVal &lt; 200)){


to

int svalue(int analogVal){
    Serial.print("entering svalue - analogVal=");
    Serial.println(analogVal);

    if((analogVal &gt; 135) &amp;&amp; (analogVal &lt; 200)){


So we can see what is happening inside svalue.

To a reasonable approximation analogRead(A1) generates random numbers with an unknown range.

Replace it with either a fixed value, or something very predictable, like a for loop.

Change

void loop() {
  int pval = svalue(analogRead(A1));
  mySerial.write(pval);
}


To:

void loop() {
  int pval = analogRead(A1);     // = svalue(analogRead(A1));
  Serial.print("analogRead(A1)=");
  Serial.println(pval);
  int i;
  for (i=0; i&lt;1024; i+=10) {    // print range of analogRead, in steps of 10
    pval = svalue(i);
    Serial.print(i);
    Serial.print(" svalue(i)=");
    Serial.print(pval);    // mySerial.write(pval);
    Serial.println();
  }
}


Now you have something which can be debugged more easily. 

Edit:
Changed the for loop to use steps of 10 to make it easier to see what is happening, and retained printing analogRead(A1) value. At least this approach tests svalue().

It is plausible that the something is wrong with that analogue input, or the electronics connected to A1 is broken, and hence analogRead returns nonsense. 

Try each different analogue input.
Try to use something simple and (mostly) predictable like two fixed resistors (say 1K and 1K) to make a voltage divider for the analogue input to measure. Or try something controllable like a potentiometer which should allow you to see the voltage being driven in a direction, and test most of the range.

If you have an effective way to test binary values, and do need the value from svalue() to be output as a binary character code, replace Serial.print(pval); with Serial.write(pval);.