When I wire my switch to pin 2, it works as expected - while the switch is pressed, the state is LOW and actions can happen in the loop. When I wire my switch to pin 11 or 12 (and change buttonPin to 11 or 12 in the sketch), when I press it, the state then stays LOW forever, even when I release it.

I am currently using pin 2 for Data 7 on the LCD and I can't work out why they behave differently.

Also, with the wifi shield, can I still use pins 11, 12 and 13 as input / output pins ? Or does the shield need them like it does 10 and 7 ?

Pins 10,11,12,13 are the SPI port. SPI is also broken out on the ICSP header.

The wifi shield uses SPI, via the ICSP header, so you can't use pins 10-13 for normal I/O or you will interfere with the SPI bus

Both the wifi chip and the SD card use SPI, with the wifi CS on hardware CS Pin 10 and the SD Card on Pin 4.

So, with the wifi shield connected, you should not use pins 4,10,11,12 or 13.

EDIT: From your post you also just mention wiring a switch to make an input go Low, so presumably you're connecting this switch to Gnd. You don't mention any pull-up resistors (internal or external) so your High state could actually be a floating input. If you understand pullup/pulldown resistors then fine, else you may want to read up on the importance of putting a pin into a known state before you apply any other input.

If it's something like a 16x2 or 2x40 character based display then there are ways of reducing the number of pins required by using IO expansion, in the form of Shift Registers or I2C expanders.

A common way is an I2C 'backpack' which will allow you to run a 1602/2004 with just 2 data pins plus supply.

Using the New LiquidCrystal library you also have the option of Shift Registers in 3 wire, 2 wire or even 1 wire configurations.

There are also ways to get more inputs for switches/buttons. You could use a voltage divide on an Analog pin to do something like 5-6 buttons on a single pin. You could use Shift Registers to get multiple inputs from 3 pins; 8 from a single 8 bit SR or cascade for up to 16, 24, 32 etc from the same 3 Arduino pins (using ShiftIn for inputs, or ShiftOut for outputs). You can even matrix your buttons and make use of the Keypad library to lower pin count, i.e 16 buttons with 8 pins. You can even combine and use Keypad I2C library with an I2C expanders to get 16 buttons on 2 pins.

No, you can digitalWrite and digitalRead the analog pins just fine. They respond to the A0, A1 etc labels but also simply as pins 14--19 too.

If you are going to look at reducing your 1602 pins down with a 595 SR then you want the New LiquidCrystal Library. This replaces the original Arduino one and provides support for 4 & 8 bit parallel, I2C, 3 wire SR, 2 wire SR and 1 wire SR. All the details on connection are provided with the library.

https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home

The new library is considerably faster than the original. 2 wire SR is said to be the fastest, but I haven't tried this myself yet.

Make sure you remove any orIginal LiquidCrystal or LiquidCrystal_I2C libraries before installing the new one (which replaces both). If you just rename the old folders then you will have conflicts.